package com.example.supplychainbackend;
import com.example.supplychainbackend.controller.dto.TodoDto;
import com.example.supplychainbackend.controller.dto.design.BOMDto;
import com.example.supplychainbackend.controller.dto.enterprise.EnterpriseCertDto;
import com.example.supplychainbackend.controller.dto.logistic.DomesticLogisticDto;
import com.example.supplychainbackend.controller.dto.logistic.ForeignLogisticDto;
import com.example.supplychainbackend.controller.dto.plan.*;
import com.example.supplychainbackend.controller.dto.plan.cost.CostCalcDto;
import com.example.supplychainbackend.controller.dto.plan.cost.CostInfoDto;
import com.example.supplychainbackend.controller.dto.plan.cost.SettleRuleDto;
import com.example.supplychainbackend.controller.dto.production.ProductionCertDto;
import com.example.supplychainbackend.controller.dto.production.ProductionProcessDto;
import com.example.supplychainbackend.controller.dto.production.ProductionSchedulingDto;
import com.example.supplychainbackend.controller.dto.production.ProductionWorkorderDto;
import com.example.supplychainbackend.controller.dto.project.PlanDetailDto;
import com.example.supplychainbackend.controller.dto.project.ProjectFolderDto;
import com.example.supplychainbackend.controller.dto.project.ProjectNodeDto;
import com.example.supplychainbackend.controller.dto.project.ProjectPlanDto;
import com.example.supplychainbackend.controller.dto.purchase.PurchaseContractDto;
import com.example.supplychainbackend.controller.dto.purchase.PurchaseMaterialDto;
import com.example.supplychainbackend.controller.dto.purchase.PurchaseOrderDto;
import com.example.supplychainbackend.controller.dto.purchase.PurchaseRequireDto;
import com.example.supplychainbackend.controller.dto.quality.*;
import com.example.supplychainbackend.controller.dto.sales.*;
import com.example.supplychainbackend.controller.dto.user.UserSigDto;
import com.example.supplychainbackend.controller.dto.warehouse.*;
import com.example.supplychainbackend.dao.EnterpriseDao;
import com.example.supplychainbackend.dao.quality.InspectionRequestDao;
import com.example.supplychainbackend.entity.EnterpriseEntity;
import com.example.supplychainbackend.entity.quality.InspectionItemEntity;
import com.example.supplychainbackend.entity.quality.InspectionOrderItemEntity;
import com.example.supplychainbackend.entity.quality.InspectionRequestEntity;
import com.example.supplychainbackend.service.*;
import com.example.supplychainbackend.tool.DateTimeUtils;
import com.github.javafaker.Faker;
import jakarta.transaction.Transactional;
import org.bouncycastle.operator.bc.BcSignerOutputStream;
import org.mapstruct.control.MappingControl;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import lombok.RequiredArgsConstructor;

import java.util.*;

@Component
@Transactional
@RequiredArgsConstructor
public class DataInitializer implements CommandLineRunner {

    private final EnterpriseDao enterpriseDao;
    private final InspectionRequestDao inspectionRequestDao;
    private final EnterpriseService enterpriseService;
    private final SalesService salesService;
    private final WarehouseService warehouseService;
    private final DesignService designService;
    private final LogisticService logisticService;
    private final PurchaseService purchaseService;
    private final PlanService planService;
    private final ProductionService productionService;
    private final QualityService qualityService;
    private final ProjectService projectService;
    private final SuperviseService superviseService;
    private final TodoService todoService;

    private final Faker faker = new Faker(Locale.CHINA, new Random(1551));

    public PurchaseOrderDto makeSavePurchaseOrder(BOMDto bom, PurchaseRequireDto pr, String dest, String contractNo, UserSigDto sigDto){
        return this.makeSavePurchaseOrder(bom, pr, dest, contractNo, sigDto, "2025-03-22");
    }
    public PurchaseOrderDto makeSavePurchaseOrder(BOMDto bom, PurchaseRequireDto pr, String dest, String contractNo,
                                                  UserSigDto sigDto, String oDate){
        PurchaseOrderDto purchaseOrderDto = PurchaseOrderDto.builder().supplierName(pr.getSupplierName())
                .contractName(bom.getMaterialName()+"采购订单"+contractNo.substring(6))
                .salesOrderName(salesService.getOrder(bom.getOrderId()).getSalesOrderName())
                .purchaseType(pr.getPurchaseType()).paymentMethod(6).localCurrency("CNY")
                .destination(dest).purchaser(sigDto.getUserName()).orderDate(oDate)
                .contractNumber(contractNo)
                .status(7)
                .totalAmountWithTax(pr.getRequiredQuantity() * pr.getPriceBeforeTax())
                .plannedEarliestDeliveryDate(pr.getPlannedArrivalDate())
                .plannedDeliveryDate(pr.getPlannedArrivalDate())
                .userName(sigDto.getUserName())
                .userId(sigDto.getUserId())
                .enterpriseName(sigDto.getEnterpriseName())
                .enterpriseId(sigDto.getEnterpriseId()).build();
        PurchaseMaterialDto purchaseMaterialDto = PurchaseMaterialDto.builder().lineNumber(bom.getBomLineNumber())
                .materialName(bom.getMaterialName()).materialNumber(bom.getMaterialCode())
                .workOrderNumber(pr.getWorkOrderNumber()).purchaseGroup(pr.getPurchaseGroup())
                .originalRequiredQuantity(pr.getRequiredQuantity()).purchaseUnit(pr.getPurchaseUnit())
                .priceBeforeTax(pr.getPriceBeforeTax())
                .totalAmountBeforeTax(pr.getPriceBeforeTax()* pr.getRequiredQuantity())
                .requiredDeliveryDate(pr.getRequiredDeliveryDate())
                .purchaseRequestNumber(pr.getPurchaseRequestNumber())
                .receivingLocation(pr.getPlannedReceivingLocation()).manufacturer(purchaseOrderDto.getSupplierName())
                .build();
        List<PurchaseMaterialDto> l1 = new ArrayList<>();
        l1.add(purchaseMaterialDto);
        purchaseOrderDto.setMaterialList(l1);
        purchaseOrderDto.setPurchaseOrderNumber(purchaseService.createPurchaseOrder(purchaseOrderDto));
        return purchaseOrderDto;
    }

    public PurchaseContractDto makeSavePurchaseContract(PurchaseRequireDto pr, String status){
        PurchaseContractDto purchaseContractDto = PurchaseContractDto.builder().contractType("SALES_CONTRACT")
                .supplierName(pr.getSupplierName()).orderType(1)
                .taxExcludedAmount(pr.getPriceBeforeTax()* pr.getRequiredQuantity())
                .createDate(DateTimeUtils.getCurrentDateTime()).status(status).build();
        purchaseContractDto.setContractNo(purchaseService.createPurchaseContract(purchaseContractDto));
        return purchaseContractDto;
    }

    public PlanOrderDetailDto makeSavePlanOrder(OrderDetailDto so, UserSigDto sigDto){
        ContractDto co = salesService.getContract(so.getContractNumber());
        ProductionDescDto descDto = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(so.getId())
                .salesOrderName(so.getSalesOrderName()).customerName(co.getCustomerName())
                .contractNumber(co.getContractNumber()).contractName(co.getContractName())
                .deliveryDate(co.getRequiredDeliveryDate()).deliveryGroupNumber(co.getProductGroup())
                .materialCode(co.getDeliverable().get(0).getMaterialNumber()).build();

        ProductionScheduleDto scheduleDto = ProductionScheduleDto.builder().materialCode(descDto.getMaterialCode())
                .workOrderType(1).area("E").productionLine("A").processRoute("EA").productionQuantity(0)
                .plannedEndDate("2025-09-22").plannedEndDate("2025-09-22").storageQuantity(0).storageLocation("MAIN")
                .build();

        List<BOMInfoDto> bomInfoDtos = new ArrayList<>();
        List<MaterialInfoDto> materialInfoDtos = new ArrayList<>();
        List<BOMDto> bomDtos = designService.getBOMsByOrder(so.getId());
        for (BOMDto designBom:
             bomDtos) {

            if (Objects.equals(designBom.getMaterialCode(), descDto.getMaterialCode())){
                scheduleDto.setRequiredQuantity(designBom.getQuantity());
                continue;
            }

            BOMInfoDto bomInfo = BOMInfoDto.builder().materialCode(designBom.getMaterialCode())
                    .materialName(designBom.getMaterialName()).materialDesc(designBom.getMaterialDesc())
                    .quantity(designBom.getQuantity()).manufacturer(designBom.getManufacturer())
                    .substituteType(1).unit(designBom.getUnit())
                    .build();
            bomInfoDtos.add(bomInfo);
            MaterialInfoDto matInfo = MaterialInfoDto.builder()
                    .kitStatus(0).materialCode(bomInfo.getMaterialCode())
                    .materialName(bomInfo.getMaterialName())
                    .materialDesc(bomInfo.getMaterialDesc())
                    .unit(bomInfo.getUnit())
                    .issueType(1)
                    .receivedQuantity(bomInfo.getQuantity())
                    .consumedQuantity(bomInfo.getQuantity())
                    .unreceivedQuantity(0).availableQuantity(0)
                    .shortageQuantity(0).plannedArrivalDate("2025-09-22")
                    .actualArrivalDate("2025-09-22").build();
            materialInfoDtos.add(matInfo);
        }
        List<MatchingPlanDto> matchingPlanDtos = new ArrayList<>();
        matchingPlanDtos.add(new MatchingPlanDto("标准装配方案","标准电子产品装配流程", true));
        matchingPlanDtos.add(new MatchingPlanDto("紧急生产方案", "紧急订单优先生产流程", false));
        matchingPlanDtos.add(new MatchingPlanDto("小量试产方案", "新产品小批量试产流程", false));
        PreparationDto preparationDto = new PreparationDto(bomInfoDtos,materialInfoDtos,matchingPlanDtos);

        List<SettleRuleDto> settleRuleDtos = Arrays.asList(
                new SettleRuleDto("1","仓库",90,"1"),
                new SettleRuleDto("1","质检部",10,"1"));

        CostInfoDto costInfoDto = new CostInfoDto(new CostCalcDto(), settleRuleDtos);

        PlanOrderDetailDto detailDto = new PlanOrderDetailDto(null, descDto, scheduleDto,
                preparationDto, "未完工", costInfoDto,
                null,null,null,null,null,null,null);

        String mo = planService.createPlanOrder(detailDto);
        return planService.getPlanOrderDetail(mo);
    }

    public ProductionWorkorderDto makeSaveProdOrder(PlanOrderDetailDto po, int quantity, UserSigDto sigDto) {
        ProductionWorkorderDto wo = ProductionWorkorderDto.builder().planOrderNo(po.getWorkOrderNumber())
                .materialCode(po.getProductionDesc().getMaterialCode()).workOrderQuantity(quantity).area("A001")
                .materialDesc("高精度红外光电传感器，IP67防护").materialName("光电传感器成品")
                .productionLine("PL001").processRoute("standardProcess")
                .plannedStartDate("2025-04-02")
                .plannedEndDate("2025-04-02").workOrderType(1).priority(50).reportedQuantity(0)
                .userName(sigDto.getUserName())
                .userId(sigDto.getUserId())
                .enterpriseName(sigDto.getEnterpriseName())
                .enterpriseId(sigDto.getEnterpriseId()).build();
        String woNo = productionService.createProductionWorkorder(wo);
        wo.setWorkOrderNo(woNo);
        return wo;
    }

    public ProductionSchedulingDto makeSaveProdSchedule(ProductionWorkorderDto wo,String equipment, int quantity, UserSigDto sigDto) {
        BOMDto bom = designService.getBOMByCode(wo.getMaterialCode());
        ProductionSchedulingDto schedulingDto = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo(equipment).equipmentName("装配机"+ equipment).area(wo.getArea())
                .productionLine(wo.getProductionLine()).processRoute(wo.getProcessRoute())
                .workOrderNo(wo.getWorkOrderNo()).workOrderLineNo(wo.getWorkOrderLineNo())
                .materialCode(bom.getMaterialCode()).materialName(bom.getMaterialName())
                .materialDesc(bom.getMaterialDesc()).scheduledStartDate(wo.getPlannedStartDate())
                .scheduledEndDate(wo.getPlannedEndDate()).scheduledQuantity(quantity).reportedQuantity(0)
                .createTime(wo.getPlannedStartDate())
                .userName(sigDto.getUserName())
                .userId(sigDto.getUserId())
                .enterpriseName(sigDto.getEnterpriseName())
                .enterpriseId(sigDto.getEnterpriseId()).build();
        Long id = productionService.createProductionScheduling(schedulingDto);
        schedulingDto.setId(String.valueOf(id));
        return schedulingDto;
    }

    @Override
    public void run(String... args) throws Exception {

        // 企业数据
        String name1 = faker.name().fullName();
        String entpAddr ="江苏省苏州市吴中区星湖街328号创意产业园";

        String name2 = faker.name().fullName();
        String entpAddr2 ="浙江省温州市乐清市柳市镇鹤闻工业园";

        String name3 = faker.name().fullName();
        String entpAddr3 ="陕西省西咸新区沣东新城协同创新港";

        String name4 = faker.name().fullName();
        String entpAddr4 ="湖南省岳阳经济技术开发区岳阳大道工业园";

        EnterpriseEntity enterprise1 = EnterpriseEntity.builder().company("苏州寰盛制造有限公司").code("11451100810419192E")
                .type(1).owner(name1).phone(faker.phoneNumber().phoneNumber())
                .email("enterprise@eto.jh.com")
                .address(entpAddr).build();
        enterpriseDao.save(enterprise1);

        EnterpriseEntity enterprise2 = EnterpriseEntity.builder().company("温州鹤闻制造有限公司").code("21457479892507112E")
                .type(1).owner(name2).phone(faker.phoneNumber().phoneNumber())
                .email("production@outsource.hw.com")
                .address(entpAddr2).build();
        enterpriseDao.save(enterprise2);

        EnterpriseEntity enterprise3 = EnterpriseEntity.builder().company("西安横垣质量检测有限公司").code("30977479846507772E")
                .type(1).owner(name3).phone(faker.phoneNumber().phoneNumber())
                .email("Info@quality.xahy.com")
                .address(entpAddr3).build();
        enterpriseDao.save(enterprise3);

        EnterpriseEntity enterprise4 = EnterpriseEntity.builder().company("湖南许科新能源有限公司").code("41272789544657546E")
                .type(1).owner(name4).phone(faker.phoneNumber().phoneNumber())
                .email("production@copper.cl.com")
                .address(entpAddr4).build();
        enterpriseDao.save(enterprise4);

        EnterpriseCertDto certDto1 = EnterpriseCertDto.builder().name(name1).id(faker.idNumber().valid())
                .idCard("url1")
                .trustCode("11451100810419192E")
                .license("http://localhost:8080/api/files/90321941-e0bc-4385-9ca4-f01b3032eace.jpeg")
                .code("http://localhost:8080/api/files/a8ad2491-e9c3-4909-85df-28bacf477d06.jpeg")
                .tax("http://localhost:8080/api/files/b10de9a5-ab1a-41f6-980f-c88a4db8e89c.jpeg")
                .build();
        enterpriseService.applyEnterpriseCert(1L,certDto1);
        EnterpriseCertDto certDto2 = EnterpriseCertDto.builder().name(name2).id(faker.idNumber().valid())
                .idCard("url1")
                .trustCode("21457479892507112E")
                .license("url2")
                .code("url3")
                .tax("url4").build();
        enterpriseService.applyEnterpriseCert(2L,certDto2);
        EnterpriseCertDto certDto3 = EnterpriseCertDto.builder().name(name3).id(faker.idNumber().valid())
                .idCard("url1")
                .trustCode("30977479846507772E")
                .license("http://localhost:8080/api/files/ec97c652-9af0-4ce3-beb8-6154c4c0245c.jpeg")
                .code("http://localhost:8080/api/files/fb19112d-1ae3-4f12-939c-f6ba0a1c82cd.jpeg")
                .tax("http://localhost:8080/api/files/a67b039c-240d-457d-8f85-e2f6cc8f19ce.jpg").build();
        enterpriseService.applyEnterpriseCert(3L,certDto3);
        EnterpriseCertDto certDto4 = EnterpriseCertDto.builder()
                .name(name4).id(faker.idNumber().valid())
                .idCard("url1")
                .trustCode("41272789544657546E")
                .license("http://localhost:8080/api/files/de73926a-c2ae-46b8-a47a-863c481d0d3f.png")
                .code("http://localhost:8080/api/files/8c3c0499-0e2a-4599-9711-0585284d5cc9.jpg")
                .tax("http://localhost:8080/api/files/68c94380-7772-48fb-b321-f1db7e439a26.jpg")
                .build();
        enterpriseService.applyEnterpriseCert(4L,certDto4);

        superviseService.reviewEnterpriseCertApply(1L, 1);
        superviseService.reviewEnterpriseCertApply(2L, 1);
        superviseService.reviewEnterpriseCertApply(3L, 1);
        superviseService.reviewEnterpriseCertApply(4L, 1);

        UserSigDto sig1 = UserSigDto.builder()
                .userName("李城辉").userId("7596")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();
        UserSigDto sig1PR = UserSigDto.builder()
                .userName("陈采购").userId("7597")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();
        UserSigDto sig1PRRV = UserSigDto.builder()
                .userName("邱采审").userId("7598")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();
        UserSigDto sig1DS = UserSigDto.builder()
                .userName("刘工设").userId("7599")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();
        UserSigDto sig1WH = UserSigDto.builder()
                .userName("朱仓廪").userId("7569")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();
        UserSigDto sig1PL = UserSigDto.builder()
                .userName("李划规").userId("7568")
                .enterpriseName("苏州寰盛制造有限公司").enterpriseId("1").build();

        UserSigDto sig2 = UserSigDto.builder()
                .userName("潘承产").userId("7600")
                .enterpriseName("温州鹤闻制造有限公司").enterpriseId("2").build();
        UserSigDto sig2sche = UserSigDto.builder()
                .userName("胡掌线").userId("7601")
                .enterpriseName("温州鹤闻制造有限公司").enterpriseId("2").build();

        UserSigDto sig3QA = UserSigDto.builder()
                .userName("秦质查").userId("7907")
                .enterpriseName("西安横垣质量检测有限公司").enterpriseId("3").build();

        UserSigDto sig4 = UserSigDto.builder()
                .userName("吕克同").userId("7931")
                .enterpriseName("湖南许科新能源有限公司").enterpriseId("4").build();



        ProductionCertDto prdCertBattery = ProductionCertDto.builder()
                .productName("石墨烯负极锂离子电池")
                .fileImg("http://localhost:8080/api/files/661e32dc-d3de-4295-a74b-c90ab3269c3d.jpeg")
                .time("2021-11-17 10:00:00")
                .standard("GB/T 36276-2018")
                .leader("程品恬")
                .phone("17988607752")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        ProductionCertDto prdCertPhone = ProductionCertDto.builder()
                .productName("智能手机")
                .fileImg("http://localhost:8080/api/files/cb7c3705-805d-41df-b90b-66480a084f33.jpeg")
                .time("2022-01-05 11:30:00")
                .standard("GB/T 42002-2022")
                .leader("许勤旭")
                .phone("15733907765")
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        productionService.createProductionCert(prdCertBattery);
        productionService.createProductionCert(prdCertPhone);
        superviseService.reviewProductionCertApply(1L, 1);
        superviseService.reviewProductionCertApply(2L, 1);

        // 客户数据

            CustomerDetailDto customerA = CustomerDetailDto.builder().id("C20240301001")
                    .customerCode("C20240301001")
                    .uniformCreditCode("91310000XXXXX12345X")
                    .customerShortName("上海贸易")
                    .customerName("上海贸易有限公司")
                    .customerLocation("上海市静安区")
                    .customerCategory(1)
                    .industryType(2)
                    .businessScope("机械设备、电子产品、化工产品销售与贸易")
                    .contactPerson("张三")
                    .contactPhone("021-12345678")
                    .mobile("13812345678")
                    .fax("021-87654321")
                    .email("sales@shtrading.com")
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(1)
                    .province("上海市")
                    .city("上海市")
                    .area("静安区")
                    .pricingProcess("标准定价")
                    .detailAddress("上海市静安区南京西路1266号恒隆广场25楼")
                    .salesPerson("李四")
                    .amountCalculationBase(1)
                    .company(1)
                    .build();
            PaymentInfoDto paymentInfoA1 = PaymentInfoDto.builder().customerId("C20240301001")
                    .bankName(1)
                    .bankAccount("62220000XXXXXXXX1234")
                    .openBank("工商银行上海静安支行")
                    .bankAddress("上海市静安区南京西路1388号").build();
            PaymentInfoDto paymentInfoA2 = PaymentInfoDto.builder().customerId("C20240301001")
                    .bankName(2)
                    .bankAccount("62250000XXXXXXXX5678")
                    .openBank("建设银行上海分行营业部")
                    .bankAddress("上海市黄浦区淮海中路200号").build();
            customerA.setPayment(Arrays.asList(paymentInfoA1, paymentInfoA2));
            InvoiceInfoDto invoiceInfoA1 = InvoiceInfoDto.builder().customerId("C20240301001")
                    .invoiceType(1)
                    .invoiceName("上海贸易有限公司")
                    .taxNumber("91310000XXXXX12345X")
                    .address("上海市静安区南京西路1266号恒隆广场25楼")
                    .phoneNumber("021-12345678")
                    .bankName("工商银行上海静安支行")
                    .bankAccount("62220000XXXXXXXX1234")
                    .build();
            customerA.setInvoice(Arrays.asList(invoiceInfoA1));
            CustomerDetailDto customerB = CustomerDetailDto.builder().id("C20240301002")
                    .customerCode("C20240301002")
                    .uniformCreditCode("91440300XXXXX67890Y")
                    .customerShortName("深圳科技")
                    .customerName("深圳科技发展有限公司")
                    .customerLocation("广东省深圳市")
                    .customerCategory(3)
                    .industryType(5)
                    .businessScope("电子产品研发、生产与销售")
                    .contactPerson("王五")
                    .contactPhone("0755-87654321")
                    .mobile("13987654321")
                    .fax("0755-12345678")
                    .email("contact@sztech.com")
                    .settlementCurrency("USD")
                    .country("中国")
                    .paymentMethod(2)
                    .province("广东省")
                    .city("深圳市")
                    .area("南山区")
                    .pricingProcess("客户特殊定价")
                    .detailAddress("广东省深圳市南山区科技园北区15栋")
                    .salesPerson("赵六")
                    .amountCalculationBase(2)
                    .company(3)
                    .build();
            PaymentInfoDto paymentInfoB1 = PaymentInfoDto.builder().customerId("C20240301002")
                    .bankName(6)
                    .bankAccount("62280000XXXXXXXX9876")
                    .openBank("招商银行深圳科技园支行")
                    .bankAddress("广东省深圳市南山区科苑路15号").build();
            customerB.setPayment(Arrays.asList(paymentInfoB1));

            CustomerDetailDto customerC = CustomerDetailDto.builder()
                    .id("C20240301003")
                    .customerCode("C20240301003")
                    .uniformCreditCode("91330100XXXXX23456Z")
                    .customerShortName("杭州电气")
                    .customerName("杭州电气设备有限公司")
                    .customerLocation("浙江省杭州市")
                    .customerCategory(2)
                    .industryType(3)
                    .businessScope("电气设备制造、销售及技术服务")
                    .contactPerson("孙明")
                    .contactPhone("0571-88776655")
                    .mobile("13711223344")
                    .fax("0571-88776654")
                    .email("info@hzelectric.com")
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(3)
                    .province("浙江省")
                    .city("杭州市")
                    .area("滨江区")
                    .pricingProcess("标准定价")
                    .detailAddress("浙江省杭州市滨江区江南大道3588号恒生科技园")
                    .salesPerson("钱七")
                    .amountCalculationBase(1)
                    .company(2)
                    .build();
            CustomerDetailDto customerD = CustomerDetailDto.builder()
                    .id("C20240301004")
                    .customerCode("C20240301004")
                    .uniformCreditCode("91110000XXXXX34567A")
                    .customerShortName("北京智能")
                    .customerName("北京智能控制系统股份有限公司")
                    .customerLocation("北京市海淀区")
                    .customerCategory(4)
                    .industryType(6)
                    .businessScope("自动化控制系统、智能设备研发与制造")
                    .contactPerson("周华")
                    .contactPhone("010-66889900")
                    .mobile("18922334455")
                    .fax("010-66889901")
                    .email("sales@bjsmart.com")
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(1)
                    .province("北京市")
                    .city("北京市")
                    .area("海淀区")
                    .pricingProcess("大客户定价")
                    .detailAddress("北京市海淀区中关村南大街5号中关村软件园")
                    .salesPerson("吴八")
                    .amountCalculationBase(1)
                    .company(2)
                    .build();
            CustomerDetailDto customerE = CustomerDetailDto.builder()
                    .id("C20240301005")
                    .customerCode("C20240301005")
                    .uniformCreditCode("91320100XXXXX45678B")
                    .customerShortName("南京能源")
                    .customerName("南京新能源科技有限公司")
                    .customerLocation("江苏省南京市")
                    .customerCategory(2)
                    .industryType(7)
                    .businessScope("新能源设备研发、生产和销售")
                    .contactPerson("郑九")
                    .contactPhone("025-83456789")
                    .mobile("13833445566")
                    .fax("025-83456788")
                    .email("contact@njnewenergy.com")
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(4)
                    .province("江苏省")
                    .city("南京市")
                    .area("江宁区")
                    .pricingProcess("标准定价")
                    .detailAddress("江苏省南京市江宁区胜太路88号南京软件园")
                    .salesPerson("李四")
                    .amountCalculationBase(1)
                    .company(2)
                    .build();
            CustomerDetailDto customerF = CustomerDetailDto.builder()
                    .id("C20240301006")
                    .customerCode("C20240301006")
                    .uniformCreditCode("91500000XXXXX56789C")
                    .customerShortName("重庆工业")
                    .customerName("重庆工业自动化设备有限责任公司")
                    .customerLocation("重庆市渝北区")
                    .customerCategory(1)
                    .industryType(4)
                    .businessScope("工业自动化设备开发、制造及销售")
                    .contactPerson("陈十")
                    .contactPhone("023-67890123")
                    .mobile("13944556677")
                    .fax("023-67890124")
                    .email("info@cqindustry.com")
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(1)
                    .province("重庆市")
                    .city("重庆市")
                    .area("渝北区")
                    .pricingProcess("标准定价")
                    .detailAddress("重庆市渝北区龙溪街道新南路166号")
                    .salesPerson("张三")
                    .amountCalculationBase(2)
                    .company(5)
                    .build();
            CustomerDetailDto customerG = CustomerDetailDto.builder()
                    .id("C20240507001")
                    .customerCode("C20240316001")
                    .uniformCreditCode("91500000XXXXX56789C")
                    .customerShortName("苏州寰盛")
                    .customerName("苏州寰盛制造有限公司")
                    .customerLocation("江苏苏州")
                    .customerCategory(1)
                    .industryType(4)
                    .businessScope("工业自动化设备开发、制造及销售")
                    .contactPerson(sig4.getUserName())
                    .contactPhone(enterprise1.getPhone())
                    .email(enterprise1.getEmail())
                    .settlementCurrency("CNY")
                    .country("中国")
                    .paymentMethod(1)
                    .province("江苏省")
                    .city("苏州市")
                    .area("吴中区")
                    .pricingProcess("标准定价")
                    .detailAddress("江苏省苏州市吴中区星湖街328号创意产业园")
                    .salesPerson(sig4.getUserName())
                    .amountCalculationBase(2)
                    .company(5)
                    .build();
        CustomerDetailDto customerZT = CustomerDetailDto.builder().id("C20240301003")
                .customerCode("C20210210003")
                .uniformCreditCode("91320000123456789X")
                .customerShortName("江苏中亭")
                .customerName("江苏中亭股份有限公司")
                .customerLocation("江苏省南京市")
                .customerCategory(1)
                .industryType(3)
                .businessScope("智能设备制造")
                .contactPerson("张明")
                .contactPhone("025-84567890")
                .mobile("13812345678")
                .fax("025-84567891")
                .email("contact@jszt.com")
                .settlementCurrency("CNY")
                .country("中国")
                .paymentMethod(1)
                .province("江苏省")
                .city("南京市")
                .area("江宁区")
                .pricingProcess("标准定价流程")
                .detailAddress("江苏省南京市江宁区经济技术开发区双龙大道1688号")
                .salesPerson("李华")
                .amountCalculationBase(1)
                .company(1)
                .build();


            String customerIdA = salesService.createCustomer(customerA);
            String customerIdB = salesService.createCustomer(customerB);
            String customerIdC = salesService.createCustomer(customerC);
            String customerIdD = salesService.createCustomer(customerD);
            String customerIdE = salesService.createCustomer(customerE);
            String customerIdF = salesService.createCustomer(customerF);
            String customerIdG = salesService.createCustomer(customerG);
            String customerIdZT = salesService.createCustomer(customerZT);

        // 合同数据

        ContractDto contractDtoA =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("PENDING_COMPLETION")
                .approvalStatus("APPROVED")
                .executionStatus("PARTIAL_EXECUTED")
                .contractNumber("HT202503140001")
                .contractName("2025年Q1季度电子元器件销售合同")
                .customerName("深圳市创新电子科技有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-04-30")
                .company(1)
                .productionQuantity(1500)
                .overflowQuantity(0)
                .executedQuantity(1200)
                .unexecutedQuantity(800)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("NORMAL")
                .contractAmount(221480)
                .deliverableQuantity(2000)
                .customerCode("C20250301002")
                .signDate("2025-03-01")
                .signatory("王经理")
                .creator("张三")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(2000)
                .deliveredQuantity(1000)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        DeliverableDto deliverableDtoA = DeliverableDto.builder().cabinetNumber("C001")
                .factory("F001")
                .lineNumber("10")
                .salesOrderNumber("SO202503140001")
                .materialNumber("M202503010001")
                .materialCategory(2)
                .materialSubCategory(101)
                .materialName("微控制器套组")
                .materialDescription("ARM 32位微控制器套组")
                .customerMaterialNumber("CUST-MCU-001")
                .customerMaterialName("32位MCU")
                .requiredDeliveryDate("2025-10-15")
                .promisedDeliveryDate("2025-09-27")
                .quantity(2000)
                .deliveredQuantity(800)
                .inTransitQuantity(200)
                .undeliveredQuantity(1000)
                .returningQuantity(0)
                .mainUnit("个")
                .priceBeforeTax(98)
                .taxRate(13)
                .priceWithTax(110)
                .amountBeforeTax(196000)
                .remarks("常规订单")
                .amountCalculationBase(1)
                .referenceDocNumber("REF20250314001/10")
                .exportDeliveryLocationCode("WH001")
                .exportDeliveryLocation("深圳仓")
                .contractLineNumber("10")
                .materialParamTemplate("TPL001")
                .receivableQuantity(1800)
                .costPrice(85)
                .totalAmountWithTax(221480)
                .totalCostAmount(170000)
                .build();
        contractDtoA.setDeliverable(Arrays.asList(deliverableDtoA));
        ContractDto contractDtoB =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503140002")
                .contractName("2025年机械零部件销售合同")
                .customerName("上海精密机械制造有限公司")
                .businessDepartment("MECHANICAL_DEPT")
                .requiredDeliveryDate("2025-05-15")
                .productionQuantity(0)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(1000)
                .bomTemplate("MECHANICAL_BOM")
                .contractCategory("NORMAL")
                .contractAmount(50850)
                .deliverableQuantity(1000)
                .customerCode("C20240301004")
                .signDate("2025-03-05")
                .signatory("李总监")
                .creator("李四")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(1000)
                .deliveredQuantity(0)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        DeliverableDto deliverableDtoB = DeliverableDto.builder().cabinetNumber("C002")
                .factory("F001")
                .lineNumber("20")
                .salesOrderNumber("SO202503140002")
                .materialNumber("M202503010002")
                .materialCategory(1)
                .materialSubCategory(102)
                .materialName("深沟球轴承")
                .materialDescription("6205-2RS 25x52x15mm P0级")
                .customerMaterialNumber("CUST-BRG-001")
                .customerMaterialName("轴承6205")
                .requiredDeliveryDate("2025-05-15")
                .promisedDeliveryDate("2025-05-10")
                .quantity(1000)
                .deliveredQuantity(0)
                .inTransitQuantity(0)
                .undeliveredQuantity(1000)
                .returningQuantity(0)
                .mainUnit("件")
                .priceBeforeTax(45)
                .taxRate(13)
                .priceWithTax(50)
                .amountBeforeTax(45000)
                .remarks("首批订单")
                .amountCalculationBase(1)
                .referenceDocNumber("REF20250314002/20")
                .exportDeliveryLocationCode("WH002")
                .exportDeliveryLocation("上海仓")
                .contractLineNumber("20")
                .materialParamTemplate("TPL002")
                .receivableQuantity(1000)
                .costPrice(38)
                .totalAmountWithTax(50850)
                .totalCostAmount(38000)
                .build();
        contractDtoB.setDeliverable(Arrays.asList(deliverableDtoB));
        ContractDto contractDtoC =  ContractDto.builder().contractType("PURCHASE_CONTRACT")
                .contractStatus("PENDING_COMPLETION")
                .approvalStatus("APPROVED")
                .executionStatus("PARTIAL_EXECUTED")
                .contractNumber("HT202503140003")
                .contractName("光电传感器采购协议")
                .customerName("杭州光电技术有限公司")
                .company(1)
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-06-10")
                .productionQuantity(0)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(500)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("NORMAL")
                .contractAmount(44355)
                .deliverableQuantity(500)
                .customerCode("C20240301003")
                .signDate("2025-03-10")
                .signatory("陈工")
                .creator("王五")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(500)
                .deliveredQuantity(0)
                .deliverable(Arrays.asList(
                        DeliverableDto.builder()
                                .materialName("光电传感器").materialNumber("OPX-5000")
                        .priceWithTax(89).quantity(500)
                        .amountBeforeTax(44355).totalAmountWithTax(44500)
                        .mainUnit("个").build()))
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        ContractDto contractDtoD =  ContractDto.builder().contractType("SERVICE_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503140004")
                .contractName("设备维护服务合同")
                .customerName("北京智能控制系统股份有限公司")
                .businessDepartment("MECHANICAL_DEPT")
                .requiredDeliveryDate("2025-03-30")
                .productionQuantity(1)
                .overflowQuantity(0)
                .executedQuantity(1)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(159000)
                .deliverableQuantity(1)
                .customerCode("C20240301004")
                .signDate("2025-02-15")
                .signatory("周总")
                .creator("赵六")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(1)
                .deliveredQuantity(1)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        ContractDto contractDtoE =  ContractDto.builder().contractType("REPAIR_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503140005")
                .contractName("电力设备修复合同")
                .customerName("南京新能源科技有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-04-20")
                .productionQuantity(3)
                .overflowQuantity(0)
                .executedQuantity(2)
                .unexecutedQuantity(3)
                .bomTemplate("")
                .contractCategory("PROJECT")
                .contractAmount(63600)
                .deliverableQuantity(5)
                .customerCode("C20240301005")
                .signDate("2025-03-08")
                .signatory("郑经理")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(5)
                .deliveredQuantity(2)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        ContractDto contractDtoF =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("DRAFT")
                .approvalStatus("IN_REVIEW")
                .executionStatus("NOT_EXECUTED")
                .contractNumber("HT202503140006")
                .contractName("工业自动化控制柜销售合同")
                .customerName("重庆工业自动化设备有限责任公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-05-25")
                .productionQuantity(0)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(10)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("PROJECT")
                .contractAmount(282500)
                .deliverableQuantity(10)
                .customerCode("C20240301006")
                .signDate("2025-03-15")
                .signatory("陈经理")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .creator("张三")
                .plannedQuantity(10)
                .deliveredQuantity(0)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        ContractDto contractDtoG =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503220001")
                .contractName("铜PCB板销售合同")
                .customerName("苏州寰盛制造有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-03-26")
                .productionQuantity(500)
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .overflowQuantity(0)
                .executedQuantity(500)
                .unexecutedQuantity(00)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("PROJECT")
                .contractAmount(2000)
                .deliverableQuantity(0)
                .customerCode("C20240316001")
                .signDate("2025-03-22")
                .signatory("陈经理")
                .creator("张三")
                .plannedQuantity(0)
                .deliveredQuantity(500).deliverable(Arrays.asList(
                        DeliverableDto.builder()
                                .materialName("铜PCB板").materialNumber("PCB-8L-RC-SM")
                                .priceWithTax(4).quantity(500)
                                .amountBeforeTax(1976).totalAmountWithTax(2000)
                                .mainUnit("块").build()))
                .userName(sig2.getUserName())
                .userId(sig2.getUserId())
                .enterpriseName(sig2.getEnterpriseName())
                .enterpriseId(sig2.getEnterpriseId())
                .build();

        ContractDto contractDtoH =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202207150307")
                .contractName("手机锂电池销售合同")
                .customerName("苏州寰盛制造有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2022-08-16")
                .productionQuantity(6000)
                .overflowQuantity(0)
                .executedQuantity(6000)
                .unexecutedQuantity(0)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("PROJECT")
                .contractAmount(6000*220)
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .deliverableQuantity(0)
                .customerCode("C20240316001")
                .signDate("2022-07-15")
                .signatory("陈经理")
                .creator("张三")
                .plannedQuantity(0)
                .deliveredQuantity(6000).deliverable(Arrays.asList(
                        DeliverableDto.builder()
                                .materialName("石墨烯复合锂电池模组").materialNumber("MPN0613")
                                .materialDescription("石墨烯复合负极材料锂离子电池，6500mAh")
                                .priceWithTax(220).quantity(6000)
                                .amountBeforeTax(186*6000).totalAmountWithTax(6000*220)
                                .mainUnit("块").build()))
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDtoI =  ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202206302711")
                .contractName("智能手机销售合同")
                .customerName("江苏中亭股份有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2022-08-30")
                .productionQuantity(6000)
                .overflowQuantity(0)
                .executedQuantity(6000)
                .unexecutedQuantity(0)
                .bomTemplate("ELECTRONIC_BOM")
                .contractCategory("PROJECT")
                .contractAmount(6000*3200)
                .deliverableQuantity(0)
                .customerCode("C20220316051")
                .signDate("2022-06-30")
                .signatory("陈经理")
                .creator("张三")
                .company(1)
                .salesOrganization("Org007")
                .salesChannel("DIRECT")
                .plannedQuantity(0)
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .salesArea("江浙1区")
                .orderType("1")
                .productGroup("DG008")
                .deliveryAddress(customerZT.getDetailAddress())
                .deliveredQuantity(6000).deliverable(Arrays.asList(
                        DeliverableDto.builder()
                                .materialName("智能手机").materialNumber("MPN00X1")
                                .materialCategory(3)
                                .materialSubCategory(202)
                                .materialDescription("中亭编号7400C")
                                .customerMaterialNumber("PH-7400C")
                                .customerMaterialName("Q3手机7线7400C")
                                .requiredDeliveryDate("2022-08-30")
                                .promisedDeliveryDate("2022-08-30")
                                .priceWithTax(3200).quantity(6000)
                                .amountBeforeTax(2870*6000).totalAmountWithTax(3200*6000)
                                .deliveredQuantity(6000)
                                .mainUnit("PC").build()))
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        // 电池公司假数据
        ContractDto contractDto01 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503140007")
                .contractName("高能量密度动力电池销售合同")
                .customerName("南京新能源科技有限公司")
                .company(1)
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-04-20")
                .productionQuantity(5000)
                .overflowQuantity(0)
                .executedQuantity(5000)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(925000)
                .deliverableQuantity(5000)
                .customerCode("C20240301001")
                .signDate("2025-03-08")
                .signatory("张经理")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(5000)
                .deliveredQuantity(5000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto02 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202504150002")
                .contractName("快充型锂离子电池销售协议")
                .customerName("深圳智能设备有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-06-30")
                .productionQuantity(8000)
                .overflowQuantity(0)
                .executedQuantity(4000)
                .unexecutedQuantity(4000)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(1200000)
                .deliverableQuantity(8000)
                .customerCode("C20240301002")
                .signDate("2025-04-10")
                .signatory("李总监")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(8000)
                .deliveredQuantity(4000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto03 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202505200003")
                .contractName("石墨烯复合电池批量采购合同")
                .customerName("北京新能源汽车股份有限公司")
                .businessDepartment("AUTOMOTIVE_DEPT")
                .requiredDeliveryDate("2025-07-15")
                .productionQuantity(20000)
                .overflowQuantity(500)
                .executedQuantity(20500)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(4100000)
                .deliverableQuantity(20500)
                .customerCode("C20240301003")
                .signDate("2025-05-15")
                .signatory("王总")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(20000)
                .deliveredQuantity(20500)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto04 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("DRAFT")
                .approvalStatus("IN_REVIEW")
                .executionStatus("NOT_EXECUTED")
                .contractNumber("HT202506180004")
                .contractName("高温型特种电池供应合同")
                .customerName("西部矿业集团")
                .businessDepartment("INDUSTRIAL_DEPT")
                .requiredDeliveryDate("2025-09-10")
                .productionQuantity(3000)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(3000)
                .bomTemplate("")
                .contractCategory("FRAMEWORK")
                .contractAmount(750000)
                .deliverableQuantity(3000)
                .customerCode("C20240301004")
                .signDate("2025-06-12")
                .signatory("赵部长")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(3000)
                .deliveredQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto05 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202507220005")
                .contractName("储能型磷酸铁锂电池销售协议")
                .customerName("广东电力建设公司")
                .businessDepartment("ENERGY_DEPT")
                .requiredDeliveryDate("2025-10-31")
                .productionQuantity(10000)
                .overflowQuantity(0)
                .executedQuantity(6000)
                .unexecutedQuantity(4000)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(2800000)
                .deliverableQuantity(10000)
                .customerCode("C20240301005")
                .signDate("2025-07-18")
                .signatory("陈经理")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(10000)
                .deliveredQuantity(6000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto06 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202508050006")
                .contractName("微型无人机专用电池采购合同")
                .customerName("杭州无人机科技有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-09-25")
                .productionQuantity(15000)
                .overflowQuantity(300)
                .executedQuantity(15300)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(765000)
                .deliverableQuantity(15300)
                .customerCode("C20240301006")
                .signDate("2025-08-01")
                .signatory("孙总监")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(15000)
                .deliveredQuantity(15300)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto07 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202509120007")
                .contractName("医疗设备专用电池供应协议")
                .customerName("上海医疗器械有限公司")
                .businessDepartment("MEDICAL_DEPT")
                .requiredDeliveryDate("2025-11-20")
                .productionQuantity(5000)
                .overflowQuantity(0)
                .executedQuantity(2000)
                .unexecutedQuantity(3000)
                .bomTemplate("")
                .contractCategory("PROJECT")
                .contractAmount(1250000)
                .deliverableQuantity(5000)
                .customerCode("C20240301007")
                .signDate("2025-09-08")
                .signatory("周院长")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(5000)
                .deliveredQuantity(2000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto08 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("DRAFT")
                .approvalStatus("IN_REVIEW")
                .executionStatus("NOT_EXECUTED")
                .contractNumber("HT202510080008")
                .contractName("船舶用高安全电池销售合同")
                .customerName("大连船舶制造有限公司")
                .businessDepartment("MARINE_DEPT")
                .requiredDeliveryDate("2025-12-15")
                .productionQuantity(2000)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(2000)
                .bomTemplate("")
                .contractCategory("PROJECT")
                .contractAmount(860000)
                .deliverableQuantity(2000)
                .customerCode("C20240301008")
                .signDate("2025-10-05")
                .signatory("郑船长")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(2000)
                .deliveredQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto09 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202511150009")
                .contractName("消费电子标准电池批量订单")
                .customerName("东莞电子制造有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2026-01-10")
                .productionQuantity(50000)
                .overflowQuantity(1000)
                .executedQuantity(51000)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(2550000)
                .deliverableQuantity(51000)
                .customerCode("C20240301009")
                .signDate("2025-11-10")
                .signatory("黄经理")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(50000)
                .deliveredQuantity(51000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        ContractDto contractDto10 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202512200010")
                .contractName("航空航天特种电池供应合同")
                .customerName("成都航空航天研究所")
                .businessDepartment("AEROSPACE_DEPT")
                .requiredDeliveryDate("2026-02-28")
                .productionQuantity(1000)
                .overflowQuantity(0)
                .executedQuantity(400)
                .unexecutedQuantity(600)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(3200000)
                .deliverableQuantity(1000)
                .customerCode("C20240301010")
                .signDate("2025-12-15")
                .signatory("刘所长")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(1000)
                .deliveredQuantity(400)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        // 制造
        // 电子加工企业销售合同数据
        ContractDto contractDto11 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202503200011")
                .contractName("智能手机主板加工合同")
                .customerName("盛为技术有限公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-05-15")
                .productionQuantity(50000)
                .overflowQuantity(500)
                .executedQuantity(50500)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("MAJOR")
                .contractAmount(2525000)
                .deliverableQuantity(50500)
                .customerCode("C20240301011")
                .signDate("2025-03-15")
                .signatory("张总监")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(50000)
                .deliveredQuantity(50500)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        ContractDto contractDto12 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202504250012")
                .contractName("智能手表PCBA加工协议")
                .customerName("正良科技有限责任公司")
                .businessDepartment("ELECTRONIC_DEPT")
                .requiredDeliveryDate("2025-07-20")
                .productionQuantity(100000)
                .overflowQuantity(0)
                .executedQuantity(60000)
                .unexecutedQuantity(40000)
                .bomTemplate("")
                .contractCategory("NORMAL")
                .contractAmount(1800000)
                .deliverableQuantity(100000)
                .customerCode("C20240301012")
                .signDate("2025-04-20")
                .signatory("李经理")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(100000)
                .deliveredQuantity(60000)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        ContractDto contractDto13 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202506150013")
                .contractName("工业控制板卡加工合同")
                .customerName("浙江中控技术股份有限公司")
                .businessDepartment("INDUSTRIAL_DEPT")
                .requiredDeliveryDate("2025-08-30")
                .productionQuantity(20000)
                .overflowQuantity(200)
                .executedQuantity(20200)
                .unexecutedQuantity(0)
                .bomTemplate("")
                .contractCategory("SPECIAL")
                .contractAmount(1212000)
                .deliverableQuantity(20200)
                .customerCode("C20240301013")
                .signDate("2025-06-10")
                .signatory("王总工程师")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(20000)
                .deliveredQuantity(20200)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        ContractDto contractDto14 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("COMPLETED")
                .approvalStatus("APPROVED")
                .executionStatus("FULLY_EXECUTED")
                .contractNumber("HT202508080014")
                .contractName("汽车电子控制单元加工协议")
                .customerName("优奔股份有限公司")
                .businessDepartment("AUTOMOTIVE_DEPT")
                .requiredDeliveryDate("2025-11-15")
                .productionQuantity(50000)
                .overflowQuantity(0)
                .executedQuantity(25000)
                .unexecutedQuantity(25000)
                .bomTemplate("")
                .contractCategory("MAJOR")
                .contractAmount(3750000)
                .deliverableQuantity(50000)
                .customerCode("C20240301014")
                .signDate("2025-08-05")
                .signatory("陈总监")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(50000)
                .deliveredQuantity(25000)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        ContractDto contractDto15 = ContractDto.builder().contractType("SALES_CONTRACT")
                .contractStatus("DRAFT")
                .approvalStatus("IN_REVIEW")
                .executionStatus("NOT_EXECUTED")
                .contractNumber("HT202510120015")
                .contractName("医疗设备主板加工合同")
                .customerName("迈瑞医疗国际有限公司")
                .businessDepartment("MEDICAL_DEPT")
                .requiredDeliveryDate("2026-01-20")
                .productionQuantity(15000)
                .overflowQuantity(0)
                .executedQuantity(0)
                .unexecutedQuantity(15000)
                .bomTemplate("")
                .contractCategory("URGENT")
                .contractAmount(1350000)
                .deliverableQuantity(15000)
                .customerCode("C20240301015")
                .signDate("2025-10-10")
                .signatory("赵院长")
                .creator("吴八")
                .localCurrency("CNY")
                .originalCurrency("CNY")
                .plannedQuantity(15000)
                .deliveredQuantity(0)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        //

        String contractNumberA =  salesService.createContract(contractDtoA);
        String contractNumberB =  salesService.createContract(contractDtoB);
        String contractNumberC =  salesService.createContract(contractDtoC);
        String contractNumberD =  salesService.createContract(contractDtoD);
        String contractNumberE =  salesService.createContract(contractDtoE);
        String contractNumberF =  salesService.createContract(contractDtoF);
        String contractNumberG =  salesService.createContract(contractDtoG);
        String contractNumberH =  salesService.createContract(contractDtoH);
        String contractNumberI =  salesService.createContract(contractDtoI);

        String contractNumber01 = salesService.createContract(contractDto01);
        String contractNumber02 =salesService.createContract(contractDto02);
        String contractNumber03 =salesService.createContract(contractDto03);
        String contractNumber04 =salesService.createContract(contractDto04);
        String contractNumber05 =salesService.createContract(contractDto05);
        String contractNumber06 =salesService.createContract(contractDto06);
        String contractNumber07 =salesService.createContract(contractDto07);
        String contractNumber08 =salesService.createContract(contractDto08);
        String contractNumber09 =salesService.createContract(contractDto09);
        String contractNumber10 =salesService.createContract(contractDto10);
        String contractNumber11 = salesService.createContract(contractDto11);
        String contractNumber12 =salesService.createContract(contractDto12);
        String contractNumber13 =salesService.createContract(contractDto13);
        String contractNumber14 =salesService.createContract(contractDto14);
        String contractNumber15 =salesService.createContract(contractDto15);

        salesService.updateContract(contractNumberA,contractDtoA);
        salesService.updateContract(contractNumberB,contractDtoB);
        salesService.updateContract(contractNumberC,contractDtoC);
        salesService.updateContract(contractNumberD,contractDtoD);
        salesService.updateContract(contractNumberE,contractDtoE);
        salesService.updateContract(contractNumberF,contractDtoF);
        salesService.updateContract(contractNumberG,contractDtoG);
        salesService.updateContract(contractNumberH,contractDtoH);
        salesService.updateContract(contractNumberI,contractDtoI);

        salesService.updateContract(contractNumber01,contractDto01);
        salesService.updateContract(contractNumber02,contractDto02);
        salesService.updateContract(contractNumber03,contractDto03);
        salesService.updateContract(contractNumber04,contractDto04);
        salesService.updateContract(contractNumber05,contractDto05);
        salesService.updateContract(contractNumber06,contractDto06);
        salesService.updateContract(contractNumber07,contractDto07);
        salesService.updateContract(contractNumber08,contractDto08);
        salesService.updateContract(contractNumber09,contractDto09);
        salesService.updateContract(contractNumber11,contractDto11);
        salesService.updateContract(contractNumber12,contractDto12);
        salesService.updateContract(contractNumber13,contractDto13);
        salesService.updateContract(contractNumber14,contractDto14);
        salesService.updateContract(contractNumber15,contractDto15);
        // 订单数据
        OrderDetailDto orderDetailDtoA = OrderDetailDto.builder()
                .id("SO202503140001")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("2025年Q1季度电子元器件销售订单")
                .customer("深圳市创新电子科技有限公司")
                .customerName("深圳市创新电子科技有限公司")
                .requiredDeliveryDate("2025-04-30")
                .contractNumber("HT202503140001")
                .orderDate("2025-03-14")
                .orderType(1)
                .firstSendTime("2025-03-15 09:00:00")
                .latestResendTime("2025-03-16 14:30:00")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(1800)
                .productGroup("DG001")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoA = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("深圳市宝安区")
                .originalCurrency("USD")
                .exchangeRate(7)
                .salesman("张三")
                .email("zhangsan@example.com")
                .tradeTerms("FOB")
                .remarks("常规订单")
                .shipToParty("深圳市创新电子科技有限公司宝安分公司")
                .soldToParty("深圳市创新电子科技有限公司")
                .build();
        orderDetailDtoA.setSalesInfo(salesInfoDtoA);

        OrderDetailDto orderDetailDtoB = OrderDetailDto.builder()
                .id("SO202503140002")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("2025年机械零部件销售订单")
                .customer("上海精密机械制造有限公司")
                .customerName("上海精密机械制造有限公司")
                .requiredDeliveryDate("2025-05-15")
                .contractNumber("HT202503140002")
                .orderDate("2025-03-14")
                .orderType(1)
                .firstSendTime("2025-03-16 11:20:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(1000)
                .productGroup("DG002")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoB = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("上海市松江区")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email("lisi@example.com")
                .tradeTerms("EXW")
                .remarks("常规订单")
                .shipToParty("上海精密机械制造有限公司")
                .soldToParty("上海精密机械制造有限公司")
                .build();
        orderDetailDtoB.setSalesInfo(salesInfoDtoB);

        OrderDetailDto orderDetailDtoC = OrderDetailDto.builder()
                .id("SO202503140003")
                .salesOrderType("URGENT_ORDER")
                .salesOrderName("光电传感器紧急订单")
                .customer("杭州光电技术有限公司")
                .customerName("杭州光电技术有限公司")
                .requiredDeliveryDate("2025-05-25")
                .contractNumber("HT202503140003")
                .orderDate("2025-03-14")
                .orderType(1)
                .firstSendTime("2025-03-15 08:30:00")
                .latestResendTime("2025-03-16 09:15:00")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(500)
                .productGroup("DG003")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoC = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("浙江省杭州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("王五")
                .email("wangwu@example.com")
                .tradeTerms("DAP")
                .remarks("紧急订单，优先处理")
                .shipToParty("杭州光电技术有限公司")
                .soldToParty("杭州光电技术有限公司")
                .build();
        orderDetailDtoC.setSalesInfo(salesInfoDtoC);

        OrderDetailDto orderDetailDtoD = OrderDetailDto.builder()
                .id("SO202503140004")
                .salesOrderType("SAMPLE_ORDER")
                .salesOrderName("电力设备控制系统样品订单")
                .customer("北京智能控制系统股份有限公司")
                .customerName("北京智能控制系统股份有限公司")
                .requiredDeliveryDate("2025-04-10")
                .contractNumber("HT202503140004")
                .orderDate("2025-03-14")
                .orderType(1)
                .firstSendTime("2025-03-15 14:20:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(1)
                .productGroup("DG004")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoD = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("北京市海淀区")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("赵六")
                .email("zhaoliu@example.com")
                .tradeTerms("DAP")
                .remarks("样品订单，免费提供技术支持")
                .shipToParty("北京智能控制系统股份有限公司")
                .soldToParty("北京智能控制系统股份有限公司")
                .build();
        orderDetailDtoD.setSalesInfo(salesInfoDtoD);

        OrderDetailDto orderDetailDtoE = OrderDetailDto.builder()
                .id("SO202503140005")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("变频器维修服务订单")
                .customer("南京新能源科技有限公司")
                .customerName("南京新能源科技有限公司")
                .requiredDeliveryDate("2025-04-20")
                .contractNumber("HT202503140005")
                .orderDate("2025-03-15")
                .orderType(1)
                .firstSendTime("2025-03-16 10:45:00")
                .latestResendTime("2025-03-17 15:30:00")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(2)
                .productGroup("DG005")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoE = SalesInfoDto.builder()
                .importance("LOW")
                .destination("江苏省南京市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("钱七")
                .email("qianqi@example.com")
                .tradeTerms("DAP")
                .remarks("客户要求提供详细的维修报告")
                .shipToParty("南京新能源科技有限公司")
                .soldToParty("南京新能源科技有限公司")
                .build();
        orderDetailDtoE.setSalesInfo(salesInfoDtoE);

        OrderDetailDto orderDetailDtoF = OrderDetailDto.builder()
                .id("SO202503140006")
                .salesOrderType("PROJECT_ORDER")
                .salesOrderName("工业自动化控制柜项目订单")
                .customer("重庆工业自动化设备有限责任公司")
                .customerName("重庆工业自动化设备有限责任公司")
                .requiredDeliveryDate("2025-05-25")
                .contractNumber("HT202503140006")
                .orderDate("2025-03-15")
                .orderType(1)
                .firstSendTime("")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("PROJECT")
                .receivableQuantity(0)
                .productGroup("DG006")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoF = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("重庆市渝北区")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("张三")
                .email("zhangsan@example.com")
                .tradeTerms("DAP")
                .remarks("项目订单，需要定制化设计")
                .shipToParty("重庆工业自动化设备有限责任公司")
                .soldToParty("重庆工业自动化设备有限责任公司")
                .build();
        orderDetailDtoF.setSalesInfo(salesInfoDtoF);

        OrderDetailDto orderDetailDtoG = OrderDetailDto.builder()
                .id("SO202503220001")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("铜PCB板销售订单")
                .customer("苏州精荟制造有限公司")
                .customerName("苏州精荟制造有限公司")
                .requiredDeliveryDate("2025-03-26")
                .contractNumber("HT202503220001")
                .orderDate("2025-03-22")
                .orderType(1)
                .firstSendTime("2025-03-22 16:45:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("DG008")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoG = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("江苏省苏州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("苏州精荟制造有限公司")
                .soldToParty("苏州精荟制造有限公司")
                .build();
        orderDetailDtoG.setSalesInfo(salesInfoDtoG);

        OrderDetailDto orderDetailDtoH = OrderDetailDto.builder()
                .id("SO202207150215")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("石墨烯锂离子电池销售订单")
                .customer("苏州寰盛制造有限公司")
                .customerName("苏州寰盛制造有限公司")
                .requiredDeliveryDate("2025-03-26")
                .contractNumber("HT202207150307")
                .orderDate("2022-07-15")
                .orderType(1)
                .firstSendTime("2022-07-15 14:30:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("DG008")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoH = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("江苏省苏州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("苏州寰盛制造有限公司")
                .soldToParty("苏州寰盛制造有限公司")
                .build();
        orderDetailDtoH.setSalesInfo(salesInfoDtoH);

        OrderDetailDto orderDetailDtoI = OrderDetailDto.builder()
                .id("SO202206300744")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("智能手机制造订单")
                .customer(customerZT.getCustomerName())
                .customerName(customerZT.getCustomerName())
                .requiredDeliveryDate("2022-08-30")
                .contractNumber("HT202206302711")
                .orderDate("2022-06-30")
                .orderType(1)
                .firstSendTime("2022-06-30 11:25:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("DG008")
                .invoiceQuantity(1)
                .invoiceQuantity(3200*6000)
                .receivableAmount(3200*6000)
                .receivedAmount(3200*6000)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDtoI = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("江苏省南京市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email(customerZT.getEmail())
                .tradeTerms("FOB")
                .shipToParty("江苏中亭股份有限公司")
                .shipToPartyAddress("江苏省南京市江宁区经济技术开发区双龙大道1688号")
                .shipToPartyAddressDetail("江苏省南京市江宁区经济技术开发区双龙大道1688号")
                .soldToParty("江苏中亭股份有限公司")
                .soldToPartyAddress("江苏省南京市江宁区经济技术开发区双龙大道1688号")
                .soldToPartyAddressDetail("江苏省南京市江宁区经济技术开发区双龙大道1688号")
                .build();
        orderDetailDtoI.setSalesInfo(salesInfoDtoI);

        // 电池公司
        OrderDetailDto orderDetailDto01 = OrderDetailDto.builder()
                .id("SO202503150001")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("高能量密度动力电池销售订单")
                .customer("南京新能源科技有限公司")
                .customerName("南京新能源科技有限公司")
                .requiredDeliveryDate("2025-04-20")
                .contractNumber("HT202503140007")
                .orderDate("2025-03-15")
                .orderType(1)
                .firstSendTime("2025-03-15 09:30:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT001")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto01 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("江苏省南京市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("张三")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("南京新能源科技有限公司")
                .soldToParty("南京新能源科技有限公司")
                .build();
        orderDetailDto01.setSalesInfo(salesInfoDto01);

        OrderDetailDto orderDetailDto02 = OrderDetailDto.builder()
                .id("SO202504100002")
                .salesOrderType("URGENT_ORDER")
                .salesOrderName("快充型锂离子电池销售订单")
                .customer("深圳智能设备有限公司")
                .customerName("深圳智能设备有限公司")
                .requiredDeliveryDate("2025-06-30")
                .contractNumber("HT202504150002")
                .orderDate("2025-04-10")
                .orderType(1)
                .firstSendTime("2025-04-10 14:20:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT002")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto02 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省深圳市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email(enterprise4.getEmail())
                .tradeTerms("EXW")
                .shipToParty("深圳智能设备有限公司")
                .soldToParty("深圳智能设备有限公司")
                .build();
        orderDetailDto02.setSalesInfo(salesInfoDto02);

        OrderDetailDto orderDetailDto03 = OrderDetailDto.builder()
                .id("SO202505150003")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("石墨烯复合电池批量采购订单")
                .customer("北京新能源汽车股份有限公司")
                .customerName("北京新能源汽车股份有限公司")
                .requiredDeliveryDate("2025-07-15")
                .contractNumber("HT202505200003")
                .orderDate("2025-05-15")
                .orderType(1)
                .firstSendTime("2025-05-15 10:45:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT003")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto03 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("北京市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("王五")
                .email(enterprise4.getEmail())
                .tradeTerms("CIF")
                .shipToParty("北京新能源汽车股份有限公司")
                .soldToParty("北京新能源汽车股份有限公司")
                .build();
        orderDetailDto03.setSalesInfo(salesInfoDto03);

        OrderDetailDto orderDetailDto04 = OrderDetailDto.builder()
                .id("SO202506120004")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("高温型特种电池供应订单")
                .customer("西部矿业集团")
                .customerName("西部矿业集团")
                .requiredDeliveryDate("2025-09-10")
                .contractNumber("HT202506180004")
                .orderDate("2025-06-12")
                .orderType(1)
                .firstSendTime("2025-06-12 16:30:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT004")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto04 = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("甘肃省兰州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("赵六")
                .email(enterprise4.getEmail())
                .tradeTerms("DDP")
                .shipToParty("西部矿业集团")
                .soldToParty("西部矿业集团")
                .build();
        orderDetailDto04.setSalesInfo(salesInfoDto04);

        OrderDetailDto orderDetailDto05 = OrderDetailDto.builder()
                .id("SO202507180005")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("储能型磷酸铁锂电池销售订单")
                .customer("广东电力建设公司")
                .customerName("广东电力建设公司")
                .requiredDeliveryDate("2025-10-31")
                .contractNumber("HT202507220005")
                .orderDate("2025-07-18")
                .orderType(1)
                .firstSendTime("2025-07-18 11:15:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT005")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto05 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省广州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("陈七")
                .email(enterprise4.getEmail())
                .tradeTerms("FCA")
                .shipToParty("广东电力建设公司")
                .soldToParty("广东电力建设公司")
                .build();
        orderDetailDto05.setSalesInfo(salesInfoDto05);

        OrderDetailDto orderDetailDto06 = OrderDetailDto.builder()
                .id("SO202508010006")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("微型无人机专用电池采购订单")
                .customer("杭州无人机科技有限公司")
                .customerName("杭州无人机科技有限公司")
                .requiredDeliveryDate("2025-09-25")
                .contractNumber("HT202508050006")
                .orderDate("2025-08-01")
                .orderType(1)
                .firstSendTime("2025-08-01 13:50:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT006")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto06 = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("浙江省杭州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("孙八")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("杭州无人机科技有限公司")
                .soldToParty("杭州无人机科技有限公司")
                .build();
        orderDetailDto06.setSalesInfo(salesInfoDto06);

        OrderDetailDto orderDetailDto07 = OrderDetailDto.builder()
                .id("SO202509080007")
                .salesOrderType("URGENT_ORDER")
                .salesOrderName("医疗设备专用电池供应订单")
                .customer("上海医疗器械有限公司")
                .customerName("上海医疗器械有限公司")
                .requiredDeliveryDate("2025-11-20")
                .contractNumber("HT202509120007")
                .orderDate("2025-09-08")
                .orderType(1)
                .firstSendTime("2025-09-08 15:25:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT007")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto07 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("上海市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("周九")
                .email(enterprise4.getEmail())
                .tradeTerms("CIP")
                .shipToParty("上海医疗器械有限公司")
                .soldToParty("上海医疗器械有限公司")
                .build();
        orderDetailDto07.setSalesInfo(salesInfoDto07);

        OrderDetailDto orderDetailDto08 = OrderDetailDto.builder()
                .id("SO202510050008")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("船舶用高安全电池销售订单")
                .customer("大连船舶制造有限公司")
                .customerName("大连船舶制造有限公司")
                .requiredDeliveryDate("2025-12-15")
                .contractNumber("HT202510080008")
                .orderDate("2025-10-05")
                .orderType(1)
                .firstSendTime("2025-10-05 09:10:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT008")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto08 = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("辽宁省大连市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("郑十")
                .email(enterprise4.getEmail())
                .tradeTerms("DAP")
                .shipToParty("大连船舶制造有限公司")
                .soldToParty("大连船舶制造有限公司")
                .build();
        orderDetailDto08.setSalesInfo(salesInfoDto08);

        OrderDetailDto orderDetailDto09 = OrderDetailDto.builder()
                .id("SO202511100009")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("消费电子标准电池批量订单")
                .customer("东莞电子制造有限公司")
                .customerName("东莞电子制造有限公司")
                .requiredDeliveryDate("2026-01-10")
                .contractNumber("HT202511150009")
                .orderDate("2025-11-10")
                .orderType(1)
                .firstSendTime("2025-11-10 14:40:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT009")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto09 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省东莞市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("黄十一")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("东莞电子制造有限公司")
                .soldToParty("东莞电子制造有限公司")
                .build();
        orderDetailDto09.setSalesInfo(salesInfoDto09);

        OrderDetailDto orderDetailDto10 = OrderDetailDto.builder()
                .id("SO202512150010")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("航空航天特种电池供应订单")
                .customer("成都航空航天研究所")
                .customerName("成都航空航天研究所")
                .requiredDeliveryDate("2026-02-28")
                .contractNumber("HT202512200010")
                .orderDate("2025-12-15")
                .orderType(1)
                .firstSendTime("2025-12-15 10:05:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("BAT010")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto10 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("四川省成都市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("刘十二")
                .email(enterprise4.getEmail())
                .tradeTerms("DDP")
                .shipToParty("成都航空航天研究所")
                .soldToParty("成都航空航天研究所")
                .build();
        orderDetailDto10.setSalesInfo(salesInfoDto10);
        // 电子加工企业销售订单数据
        OrderDetailDto orderDetailDto11 = OrderDetailDto.builder()
                .id("SO202503150011")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("智能手机主板加工订单")
                .customer("盛为技术有限公司")
                .customerName("盛为技术有限公司")
                .requiredDeliveryDate("2025-05-15")
                .contractNumber("HT202503200011")
                .orderDate("2025-03-15")
                .orderType(1)
                .firstSendTime("2025-03-15 10:30:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("PCB001")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto11 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省深圳市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("张三")
                .email(enterprise4.getEmail())
                .tradeTerms("FOB")
                .shipToParty("盛为技术有限公司")
                .soldToParty("盛为技术有限公司")
                .build();
        orderDetailDto11.setSalesInfo(salesInfoDto11);

        OrderDetailDto orderDetailDto12 = OrderDetailDto.builder()
                .id("SO202504200012")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("智能手表PCBA加工订单")
                .customer("正良科技有限责任公司")
                .customerName("正良科技有限责任公司")
                .requiredDeliveryDate("2025-07-20")
                .contractNumber("HT202504250012")
                .orderDate("2025-04-20")
                .orderType(1)
                .firstSendTime("2025-04-20 14:15:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("PCB002")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto12 = SalesInfoDto.builder()
                .importance("MEDIUM")
                .destination("北京市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("李四")
                .email(enterprise4.getEmail())
                .tradeTerms("EXW")
                .shipToParty("正良科技有限责任公司")
                .soldToParty("正良科技有限责任公司")
                .build();
        orderDetailDto12.setSalesInfo(salesInfoDto12);

        OrderDetailDto orderDetailDto13 = OrderDetailDto.builder()
                .id("SO202506100013")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("工业控制板卡加工订单")
                .customer("浙江中控技术股份有限公司")
                .customerName("浙江中控技术股份有限公司")
                .requiredDeliveryDate("2025-08-30")
                .contractNumber("HT202506150013")
                .orderDate("2025-06-10")
                .orderType(1)
                .firstSendTime("2025-06-10 09:45:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("PCB003")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto13 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("浙江省杭州市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("王五")
                .email(enterprise4.getEmail())
                .tradeTerms("CIF")
                .shipToParty("浙江中控技术股份有限公司")
                .soldToParty("浙江中控技术股份有限公司")
                .build();
        orderDetailDto13.setSalesInfo(salesInfoDto13);

        OrderDetailDto orderDetailDto14 = OrderDetailDto.builder()
                .id("SO202508050014")
                .salesOrderType("NORMAL_ORDER")
                .salesOrderName("汽车电子控制单元加工订单")
                .customer("优奔股份有限公司")
                .customerName("优奔股份有限公司")
                .requiredDeliveryDate("2025-11-15")
                .contractNumber("HT202508080014")
                .orderDate("2025-08-05")
                .orderType(1)
                .firstSendTime("2025-08-05 16:20:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("PCB004")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto14 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省深圳市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("赵六")
                .email(enterprise4.getEmail())
                .tradeTerms("DAP")
                .shipToParty("优奔股份有限公司")
                .soldToParty("优奔股份有限公司")
                .build();
        orderDetailDto14.setSalesInfo(salesInfoDto14);

        OrderDetailDto orderDetailDto15 = OrderDetailDto.builder()
                .id("SO202510100015")
                .salesOrderType("URGENT_ORDER")
                .salesOrderName("医疗设备主板加工订单")
                .customer("迈瑞医疗国际有限公司")
                .customerName("迈瑞医疗国际有限公司")
                .requiredDeliveryDate("2026-01-20")
                .contractNumber("HT202510120015")
                .orderDate("2025-10-10")
                .orderType(1)
                .firstSendTime("2025-10-10 11:10:00")
                .latestResendTime("")
                .company("HQ")
                .salesOrganization("CN_SALES")
                .salesChannel("DIRECT")
                .receivableQuantity(0)
                .productGroup("PCB005")
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();
        SalesInfoDto salesInfoDto15 = SalesInfoDto.builder()
                .importance("HIGH")
                .destination("广东省深圳市")
                .originalCurrency("CNY")
                .exchangeRate(1)
                .salesman("陈七")
                .email(enterprise4.getEmail())
                .tradeTerms("CIP")
                .shipToParty("迈瑞医疗国际有限公司")
                .soldToParty("迈瑞医疗国际有限公司")
                .build();
        orderDetailDto15.setSalesInfo(salesInfoDto15);
        //

        String orderId1 = salesService.createOrder(orderDetailDtoA);
        salesService.createOrder(orderDetailDtoB);
        salesService.createOrder(orderDetailDtoC);
        salesService.createOrder(orderDetailDtoD);
        salesService.createOrder(orderDetailDtoE);
        salesService.createOrder(orderDetailDtoF);
        salesService.createOrder(orderDetailDtoG);
        salesService.createOrder(orderDetailDtoH);
        salesService.createOrder(orderDetailDtoI);

        salesService.createOrder(orderDetailDto01);
        salesService.createOrder(orderDetailDto02);
        salesService.createOrder(orderDetailDto03);
        salesService.createOrder(orderDetailDto04);
        salesService.createOrder(orderDetailDto05);
        salesService.createOrder(orderDetailDto06);
        salesService.createOrder(orderDetailDto07);
        salesService.createOrder(orderDetailDto08);
        salesService.createOrder(orderDetailDto09);
        salesService.createOrder(orderDetailDto10);
        salesService.createOrder(orderDetailDto11);
        salesService.createOrder(orderDetailDto12);
        salesService.createOrder(orderDetailDto13);
        salesService.createOrder(orderDetailDto14);
        salesService.createOrder(orderDetailDto15);
        // 物料数据
        BOMDto bomDto0 = BOMDto.builder().orderId(orderId1).materialCode("STM32-709")
                .materialName("微处理器套组")
                .materialDesc("含处理器、整流器、PCB板")
                .quantity(2000).unit("套").materialCategory(2)
                .materialSubCategory(103)
                .materialSource("采购")
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();
        BOMDto bomDto1 = BOMDto.builder().orderId(orderId1).materialCode("IC-CPU-A78")
                .materialName("多核ARM处理器")
                .materialDesc("四核Cortex-A78, 主频2.8GHz, 支持LPDDR5, 工业级温度范围")
                .quantity(2000).unit("个").materialCategory(2)
                .materialSubCategory(103)
                .materialSource("采购")
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomDto2 = BOMDto.builder().orderId(orderId1).materialCode("BRIDGE-KBJ2510")
                .materialName("桥式整流器")
                .materialDesc("KBJ2510, 1000V, 25A, 标准DIP-4封装，用于电源模块")
                .quantity(2000).unit("个").materialCategory(2)
                .materialSubCategory(103)
                .materialSource("采购")
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomDto3 = BOMDto.builder().orderId(orderId1).materialCode("PCB-CP73")
                .materialName("铜PCB板")
                .materialDesc("铜蚀刻PCB版，阻抗控制，尺寸70mm*30mm，板厚1.0mm")
                .quantity(2000).unit("块").materialCategory(2)
                .materialSubCategory(103)
                .materialSource("采购")
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom1 = BOMDto.builder()
                .orderId(orderDetailDtoC.getId())  // 假设订单ID
                .materialCode("OPX-5000")
                .materialName("光电传感器成品")
                .materialDesc("高精度红外光电传感器，IP67防护")
                .quantity(500)                 // 订单量2000件
                .unit("件").materialCategory(2)
                .materialSource("采购")
                .materialSubCategory(302)    // 101-传感器类
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom3 = BOMDto.builder()
                .orderId(orderDetailDtoC.getId())
                .materialCode("PD-45A")
                .materialName("硅光敏接收器")
                .materialDesc("响应时间<10ns，暗电流0.1nA")
                .quantity(2000)                 // 2000件*1个/件
                .unit("个").materialCategory(2)
                .materialSource("采购")
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom4 = BOMDto.builder()
                .orderId(orderDetailDtoC.getId())
                .materialCode("PCB-8L")
                .materialName("8层传感器控制板")
                .materialDesc("70*50mm，阻抗控制，沉金工艺")
                .quantity(500)
                .materialSource("采购")
                .unit("块").materialCategory(2)
                .materialSubCategory(103)     // 302-PCB
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom5 = BOMDto.builder()
                .orderId(orderDetailDtoC.getId())
                .materialCode("AL-6061")
                .materialName("铝合金外壳")
                .materialDesc("阳极氧化处理，含安装孔位")
                .quantity(500)
                .materialSource("采购")
                .unit("套").materialCategory(2)
                .materialSubCategory(101)   // 301-金属件
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom6 = BOMDto.builder()
                .orderId(orderDetailDtoG.getId())
                .materialCode("PCB-8L-RC-SM")
                .materialName("8层传感器控制板")
                .materialDesc("70*50mm，阻抗控制，沉金工艺")
                .quantity(500)
                .materialSource("采购")
                .unit("块").materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1.getUserName())
                .userId(sig1.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId())
                .build();

        BOMDto bom7 = BOMDto.builder()
                .orderId(orderDetailDtoG.getId())
                .materialCode("COP99-PR")
                .materialName("99铜")
                .materialDesc("99铜")
                .quantity(5)
                .materialSource("采购")
                .unit("KG").materialCategory(2)
                .materialSubCategory(103)     // 302-PCB
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bom00 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialName("智能手机")
                .materialCode("MPN00X1")
                .materialCategory(3)
                .materialSubCategory(202)
                .materialDesc("中亭编号7400C")
                .quantity(1)
                .unit("个")
                .materialSource("生产")
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom01 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0012")
                .materialName("主控单板")
                .materialDesc("智能手机主控电路板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom02 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0070")
                .materialName("显示屏模块")
                .materialDesc("6.5英寸OLED显示模组")
                .quantity(1)
                .unit("件")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom03 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0324")
                .materialName("散热系统总成")
                .materialDesc("主动式液冷散热系统")
                .quantity(1)
                .unit("套")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(302)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom04 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0081")
                .materialName("摄像头模块")
                .materialDesc("后置三摄模组")
                .quantity(1)
                .unit("件")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(302)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom05 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0613")
                .materialName("复合锂电池模组")
                .materialDesc("石墨烯复合负极材料的6500mAh锂聚合物电池模组")
                .quantity(1)
                .unit("个")
                .materialSource("采购")
                .materialCategory(3)
                .materialSubCategory(302)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom06 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0020")
                .materialName("中框结构件")
                .materialDesc("金属中框结构组件")
                .quantity(1)
                .unit("套")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(101)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom07 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0054")
                .materialName("通信基带单板")
                .materialDesc("5G通信基带电路板")
                .quantity(2)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom08 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0458")
                .materialName("音频编解码单板")
                .materialDesc("音频处理与扬声器驱动板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom09 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0023")
                .materialName("传感器接口单板")
                .materialDesc("陀螺仪、加速度计等传感器接口")
                .quantity(16)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom010 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0459")
                .materialName("指纹识别模块")
                .materialDesc("屏下光学指纹识别模组")
                .quantity(1)
                .unit("个")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom011 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0130")
                .materialName("内存控制单板")
                .materialDesc("LPDDR5内存控制电路板")
                .quantity(2)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom012 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0133")
                .materialName("无线充电单板")
                .materialDesc("无线充电接收电路板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom013 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0057")
                .materialName("射频前端单板")
                .materialDesc("射频信号处理电路板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom014 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0061")
                .materialName("触控驱动单板")
                .materialDesc("触控屏幕驱动电路板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom015 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0062")
                .materialName("主板连接器单板")
                .materialDesc("主板连接器与接口板")
                .quantity(1)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(103)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bom016 = BOMDto.builder()
                .orderId(orderDetailDtoI.getId())
                .materialCode("MPN0041")
                .materialName("散热模块单板")
                .materialDesc("散热片与导热接口板")
                .quantity(2)
                .unit("块")
                .materialSource("采购")
                .materialCategory(2)
                .materialSubCategory(201)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomE0 = BOMDto.builder()
                .orderId(orderDetailDtoH.getId())
                .materialCode("MPN0613")
                .materialName("寰盛定制复合锂电池模组")
                .materialDesc("石墨烯复合负极材料，锂离子电池，6500mAh")
                .quantity(1)
                .unit("个")
                .materialSource("采购")
                .materialCategory(3)
                .materialSubCategory(103)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomE1 = BOMDto.builder()
                .orderId(orderDetailDtoH.getId())
                .materialCode("MPN0670")
                .materialName("热管理柔性导热胶")
                .materialDesc("填充于电芯与框架之间，用于散热与缓冲")
                .quantity(1)
                .materialSource("采购")
                .unit("件").materialCategory(5)
                .materialSubCategory(301)     // 302-PCB
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomE2 = BOMDto.builder()
                .orderId(orderDetailDtoH.getId())
                .materialCode("MPN0677")
                .materialName("石墨烯锂离子电芯")
                .materialDesc("核心储能单元，采用石墨烯复合负极技术")
                .quantity(2)
                .materialSource("库存")
                .unit("块").materialCategory(2)
                .materialSubCategory(103)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        BOMDto bomE3 = BOMDto.builder()
                .orderId(orderDetailDtoH.getId())
                .materialCode("MPN0675")
                .materialName("电池保护板（BMS板）")
                .materialDesc("负责充放电管理、电量监测及安全保护")
                .quantity(1)
                .materialSource("采购")
                .unit("块").materialCategory(2)
                .materialSubCategory(103)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        BOMDto bomE4 = BOMDto.builder()
                .orderId(orderDetailDtoH.getId())
                .materialCode("MPN0678")
                .materialName("电池模组结构框架")
                .materialDesc("用于固定电芯与保护板的绝缘结构件")
                .quantity(1)
                .materialSource("采购")
                .unit("套").materialCategory(2)
                .materialSubCategory(102)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        // 电池公司
        // 合同订单的电池物料信息
        BOMDto bomF01 = BOMDto.builder()
                .orderId(orderDetailDto01.getId())
                .materialCode("BAT-PWR-HD-001")
                .materialName("高能量密度动力电池")
                .materialDesc("6500mAh，支持120W快充，硅碳复合负极材料")
                .quantity(5000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(101)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF02 = BOMDto.builder()
                .orderId(orderDetailDto02.getId())
                .materialCode("BAT-FC-QU-002")
                .materialName("快充型锂离子电池")
                .materialDesc("4500mAh，支持100W超级快充，15分钟充满80%")
                .quantity(8000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(102)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF03 = BOMDto.builder()
                .orderId(orderDetailDto03.getId())
                .materialCode("BAT-GR-PH-003")
                .materialName("石墨烯复合电池")
                .materialDesc("7200mAh，石墨烯导电电极，循环寿命2000次")
                .quantity(20000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(103)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF04 = BOMDto.builder()
                .orderId(orderDetailDto04.getId())
                .materialCode("BAT-HT-SP-004")
                .materialName("高温型特种电池")
                .materialDesc("工作温度-40℃~85℃，防爆设计，适用于恶劣环境")
                .quantity(3000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(104)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF05 = BOMDto.builder()
                .orderId(orderDetailDto05.getId())
                .materialCode("BAT-ES-LF-005")
                .materialName("储能型磷酸铁锂电池")
                .materialDesc("10000mAh，磷酸铁锂正极，超长循环寿命3000次")
                .quantity(10000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(105)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF06 = BOMDto.builder()
                .orderId(orderDetailDto06.getId())
                .materialCode("BAT-MI-DR-006")
                .materialName("微型无人机专用电池")
                .materialDesc("1200mAh，高倍率放电，重量仅25g，适用于小型无人机")
                .quantity(15000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(106)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF07 = BOMDto.builder()
                .orderId(orderDetailDto07.getId())
                .materialCode("BAT-MD-SF-007")
                .materialName("医疗设备专用电池")
                .materialDesc("3800mAh，医用级安全标准，低自放电，长保质期")
                .quantity(5000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(107)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF08 = BOMDto.builder()
                .orderId(orderDetailDto08.getId())
                .materialCode("BAT-MR-SF-008")
                .materialName("船舶用高安全电池")
                .materialDesc("防腐蚀设计，IP68防护等级，适用于海洋环境")
                .quantity(2000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(108)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF09 = BOMDto.builder()
                .orderId(orderDetailDto09.getId())
                .materialCode("BAT-CE-ST-009")
                .materialName("消费电子标准电池")
                .materialDesc("3000mAh，标准聚合物锂电池，通用性强")
                .quantity(50000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(109)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();

        BOMDto bomF10 = BOMDto.builder()
                .orderId(orderDetailDto10.getId())
                .materialCode("BAT-AS-SP-010")
                .materialName("航空航天特种电池")
                .materialDesc("耐极端温度，抗辐射，高可靠性，适用于航空航天设备")
                .quantity(1000)
                .materialSource("自制")
                .unit("个").materialCategory(1)
                .materialSubCategory(110)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .build();
        //
        // 电子加工合同订单的物料信息
        BOMDto bomF11 = BOMDto.builder()
                .orderId(orderDetailDto11.getId())
                .materialCode("PCB-SM-8L-001")
                .materialName("智能手机主板")
                .materialDesc("8层HDI板，沉金工艺，阻抗控制，尺寸120*60mm")
                .quantity(50000)
                .materialSource("自制")
                .unit("块").materialCategory(1)
                .materialSubCategory(201)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomF12 = BOMDto.builder()
                .orderId(orderDetailDto12.getId())
                .materialCode("PCBA-WT-4L-002")
                .materialName("智能手表PCBA")
                .materialDesc("4层柔性板，01005元件，BT/WiFi模块，尺寸40*40mm")
                .quantity(100000)
                .materialSource("自制")
                .unit("块").materialCategory(1)
                .materialSubCategory(202)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomF13 = BOMDto.builder()
                .orderId(orderDetailDto13.getId())
                .materialCode("PCB-IC-6L-003")
                .materialName("工业控制板卡")
                .materialDesc("6层厚铜板，2oz铜厚，工业级元件，耐高温设计")
                .quantity(20000)
                .materialSource("自制")
                .unit("块").materialCategory(1)
                .materialSubCategory(203)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomF14 = BOMDto.builder()
                .orderId(orderDetailDto14.getId())
                .materialCode("PCBA-AU-10L-004")
                .materialName("汽车电子控制单元")
                .materialDesc("10层板，汽车级元件，AEC-Q200认证，防水防震设计")
                .quantity(50000)
                .materialSource("自制")
                .unit("块").materialCategory(1)
                .materialSubCategory(204)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();

        BOMDto bomF15 = BOMDto.builder()
                .orderId(orderDetailDto15.getId())
                .materialCode("PCB-MD-8L-005")
                .materialName("医疗设备主板")
                .materialDesc("8层板，医用级安全标准，低噪声设计，EMC防护")
                .quantity(15000)
                .materialSource("自制")
                .unit("块").materialCategory(1)
                .materialSubCategory(205)
                .userName(sig1DS.getUserName())
                .userId(sig1DS.getUserId())
                .enterpriseName(sig1DS.getEnterpriseName())
                .enterpriseId(sig1DS.getEnterpriseId())
                .build();
        //


        designService.createBOM(bomDto0);
        designService.createBOM(bomDto1);
        designService.createBOM(bomDto2);
        designService.createBOM(bomDto3);
        designService.createBOM(bom1);
        designService.createBOM(bom3);
        designService.createBOM(bom4);
        designService.createBOM(bom5);
        designService.createBOM(bom6);
        //bom05
        designService.createBOM(bomE0);
        designService.createBOM(bomE1);
        designService.createBOM(bomE2);
        designService.createBOM(bomE3);
        designService.createBOM(bomE4);
        designService.createBOM(bom00);
        designService.createBOM(bom01);
        designService.createBOM(bom02);
        designService.createBOM(bom03);
        designService.createBOM(bom04);
        designService.createBOM(bom05);
        designService.createBOM(bom06);
        designService.createBOM(bom07);
        designService.createBOM(bom08);
        designService.createBOM(bom09);
        designService.createBOM(bom010);
        designService.createBOM(bom011);
        designService.createBOM(bom012);
        designService.createBOM(bom013);
        designService.createBOM(bom014);
        designService.createBOM(bom015);
        designService.createBOM(bom016);

        designService.createBOM(bomF01);
        designService.createBOM(bomF02);
        designService.createBOM(bomF03);
        designService.createBOM(bomF04);
        designService.createBOM(bomF05);
        designService.createBOM(bomF06);
        designService.createBOM(bomF07);
        designService.createBOM(bomF08);
        designService.createBOM(bomF09);
        designService.createBOM(bomF10);
        designService.createBOM(bomF11);
        designService.createBOM(bomF12);
        designService.createBOM(bomF13);
        designService.createBOM(bomF14);
        designService.createBOM(bomF15);

        // 采购申请
        PurchaseRequireDto purchaseRequireDto1 = PurchaseRequireDto.builder().salesOrderNumber(orderId1)
                .salesOrderName(orderDetailDtoA.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomDto1.getMaterialCode()).materialName(bomDto1.getMaterialName())
                .materialDescription(bomDto1.getMaterialDesc())
                .requiredQuantity(bomDto1.getQuantity()).purchaseUnit(bomDto1.getUnit())
                .supplierName("深开鸿").priceBeforeTax(70F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C001").plannedArrivalDate("2025-07-30").build();

        PurchaseRequireDto purchaseRequireDto2 = PurchaseRequireDto.builder().salesOrderNumber(orderId1)
                .salesOrderName(orderDetailDtoA.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomDto2.getMaterialCode()).materialName(bomDto2.getMaterialName())
                .materialDescription(bomDto2.getMaterialDesc())
                .requiredQuantity(bomDto2.getQuantity()).purchaseUnit(bomDto2.getUnit())
                .supplierName("上海精密").priceBeforeTax(9F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W002")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C003").plannedArrivalDate("2025-08-02").build();

        PurchaseRequireDto purchaseRequireDto3 = PurchaseRequireDto.builder().salesOrderNumber(orderId1)
                .salesOrderName(orderDetailDtoA.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomDto3.getMaterialCode()).materialName(bomDto3.getMaterialName())
                .materialDescription(bomDto3.getMaterialDesc())
                .requiredQuantity(bomDto3.getQuantity()).purchaseUnit(bomDto3.getUnit())
                .supplierName("嘉立创").priceBeforeTax(4F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W003")
                .status("0").approvalStatus(1)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C003").plannedArrivalDate("2025-08-17").build();

        PurchaseRequireDto purchaseRequireDto4 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoC.getId())
                .salesOrderName(orderDetailDtoC.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom3.getMaterialCode()).materialName(bom3.getMaterialName())
                .materialDescription(bom3.getMaterialDesc())
                .requiredQuantity(bom3.getQuantity()).purchaseUnit(bom3.getUnit())
                .supplierName("菁华光电").priceBeforeTax(7F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C001").plannedArrivalDate("2025-03-29").build();
        PurchaseRequireDto purchaseRequireDto5 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoC.getId())
                .salesOrderName(orderDetailDtoC.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom4.getMaterialCode()).materialName(bom4.getMaterialName())
                .materialDescription(bom4.getMaterialDesc())
                .requiredQuantity(bom4.getQuantity()).purchaseUnit(bom4.getUnit())
                .supplierName("天圆精工").priceBeforeTax(4F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C001").plannedArrivalDate("2025-03-27").build();
        PurchaseRequireDto purchaseRequireDto6 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoC.getId())
                .salesOrderName(orderDetailDtoC.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom5.getMaterialCode()).materialName(bom5.getMaterialName())
                .materialDescription(bom5.getMaterialDesc())
                .requiredQuantity(bom5.getQuantity()).purchaseUnit(bom5.getUnit())
                .supplierName("宏远金属").priceBeforeTax(2F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("A.B.C001").plannedArrivalDate("2025-03-29").build();

        PurchaseRequireDto purchaseRequireDto7 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoG.getId())
                .salesOrderName(orderDetailDtoG.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom7.getMaterialCode()).materialName(bom7.getMaterialName())
                .materialDescription(bom7.getMaterialDesc())
                .requiredQuantity(bom7.getQuantity()).purchaseUnit(bom7.getUnit())
                .supplierName("贵溪铜业").priceBeforeTax(90F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .plannedReceivingLocation("C.B.C001").plannedArrivalDate("2025-03-23").build();

        PurchaseRequireDto purchaseRequireDto01 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom01.getMaterialCode()).materialName(bom01.getMaterialName())
                .materialDescription(bom01.getMaterialDesc())
                .requiredQuantity(6000*bom01.getQuantity()).purchaseUnit(bom01.getUnit())
                .supplierName("华强电子")
                .priceBeforeTax(120F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();
        // 一级物料采购申请对象

        PurchaseRequireDto purchaseRequireDto02 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom02.getMaterialCode()).materialName(bom02.getMaterialName())
                .materialDescription(bom02.getMaterialDesc())
                .requiredQuantity(6000*bom02.getQuantity()).purchaseUnit(bom02.getUnit())
                .supplierName("京方科技")
                .priceBeforeTax(180.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-13").build();

        PurchaseRequireDto purchaseRequireDto03 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom03.getMaterialCode()).materialName(bom03.getMaterialName())
                .materialDescription(bom03.getMaterialDesc())
                .requiredQuantity(6000*bom03.getQuantity()).purchaseUnit(bom03.getUnit())
                .supplierName("宁源半导体")
                .priceBeforeTax(320.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto04 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom04.getMaterialCode()).materialName(bom04.getMaterialName())
                .materialDescription(bom04.getMaterialDesc())
                .requiredQuantity(6000*bom04.getQuantity()).purchaseUnit(bom04.getUnit())
                .supplierName("舜宇光科")
                .priceBeforeTax(280.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto05 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom05.getMaterialCode()).materialName(bom05.getMaterialName())
                .materialDescription(bom05.getMaterialDesc())
                .requiredQuantity(6000*bom05.getQuantity()).purchaseUnit(bom05.getUnit())
                .supplierName("许科新能源")
                .priceBeforeTax(220.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-19").build();

        PurchaseRequireDto purchaseRequireDto06 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom06.getMaterialCode()).materialName(bom06.getMaterialName())
                .materialDescription(bom06.getMaterialDesc())
                .requiredQuantity(6000*bom06.getQuantity()).purchaseUnit(bom06.getUnit())
                .supplierName("德呈电气")
                .priceBeforeTax(60.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto07 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom07.getMaterialCode()).materialName(bom07.getMaterialName())
                .materialDescription(bom07.getMaterialDesc())
                .requiredQuantity(6000*bom07.getQuantity()).purchaseUnit(bom07.getUnit())
                .supplierName("高通科技")
                .priceBeforeTax(150.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto08 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom08.getMaterialCode()).materialName(bom08.getMaterialName())
                .materialDescription(bom08.getMaterialDesc())
                .requiredQuantity(6000*bom08.getQuantity()).purchaseUnit(bom08.getUnit())
                .supplierName("瑞声科技")
                .priceBeforeTax(80.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto09 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom09.getMaterialCode()).materialName(bom09.getMaterialName())
                .materialDescription(bom09.getMaterialDesc())
                .requiredQuantity(6000*bom09.getQuantity()).purchaseUnit(bom09.getUnit())
                .supplierName("博世传感")
                .priceBeforeTax(15.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto010 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom010.getMaterialCode()).materialName(bom010.getMaterialName())
                .materialDescription(bom010.getMaterialDesc())
                .requiredQuantity(6000*bom010.getQuantity()).purchaseUnit(bom010.getUnit())
                .supplierName("汇顶科技")
                .priceBeforeTax(112.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto011 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom011.getMaterialCode()).materialName(bom011.getMaterialName())
                .materialDescription(bom011.getMaterialDesc())
                .requiredQuantity(6000*bom011.getQuantity()).purchaseUnit(bom011.getUnit())
                .supplierName("美光科技")
                .priceBeforeTax(80.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto012 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom012.getMaterialCode()).materialName(bom012.getMaterialName())
                .materialDescription(bom012.getMaterialDesc())
                .requiredQuantity(6000*bom012.getQuantity()).purchaseUnit(bom012.getUnit())
                .supplierName("立讯精密")
                .priceBeforeTax(45.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto013 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom013.getMaterialCode()).materialName(bom013.getMaterialName())
                .materialDescription(bom013.getMaterialDesc())
                .requiredQuantity(6000*bom013.getQuantity()).purchaseUnit(bom013.getUnit())
                .supplierName("Skyworks")
                .priceBeforeTax(110.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto014 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom014.getMaterialCode()).materialName(bom014.getMaterialName())
                .materialDescription(bom014.getMaterialDesc())
                .requiredQuantity(6000*bom014.getQuantity()).purchaseUnit(bom014.getUnit())
                .supplierName("新思科技")
                .priceBeforeTax(75.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto015 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom015.getMaterialCode()).materialName(bom015.getMaterialName())
                .materialDescription(bom015.getMaterialDesc())
                .requiredQuantity(6000*bom015.getQuantity()).purchaseUnit(bom015.getUnit())
                .supplierName("安费电子")
                .priceBeforeTax(85.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        PurchaseRequireDto purchaseRequireDto016 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoI.getId())
                .salesOrderName(orderDetailDtoI.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bom016.getMaterialCode()).materialName(bom016.getMaterialName())
                .materialDescription(bom016.getMaterialDesc())
                .requiredQuantity(6000*bom016.getQuantity()).purchaseUnit(bom016.getUnit())
                .supplierName("富康制造")
                .priceBeforeTax(70.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig1PR.getUserName())
                .userId(sig1PR.getUserId())
                .enterpriseName(sig1PR.getEnterpriseName())
                .enterpriseId(sig1PR.getEnterpriseId())
                .plannedReceivingLocation("C001").plannedArrivalDate("2022-08-14").build();

        // 二级物料采购申请对象（使用bomE对象）
        PurchaseRequireDto purchaseRequireDtoE1 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoH.getId())
                .salesOrderName(orderDetailDtoH.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomE1.getMaterialCode()).materialName(bomE1.getMaterialName())
                .materialDescription(bomE1.getMaterialDesc())
                .requiredQuantity(6000*bomE1.getQuantity()).purchaseUnit(bomE1.getUnit())
                .supplierName("3M中国")
                .priceBeforeTax(185.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .plannedReceivingLocation("B02E5").plannedArrivalDate("2022-08-02").build();

        PurchaseRequireDto purchaseRequireDtoE2 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoH.getId())
                .salesOrderName(orderDetailDtoH.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomE2.getMaterialCode()).materialName(bomE2.getMaterialName())
                .materialDescription(bomE2.getMaterialDesc())
                .requiredQuantity(6000*bomE2.getQuantity()).purchaseUnit(bomE2.getUnit())
                .supplierName("许科新能源")
                .priceBeforeTax(85.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .plannedReceivingLocation("B02E6").plannedArrivalDate("2022-08-02").build();

        PurchaseRequireDto purchaseRequireDtoE3 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoH.getId())
                .salesOrderName(orderDetailDtoH.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomE3.getMaterialCode()).materialName(bomE3.getMaterialName())
                .materialDescription(bomE3.getMaterialDesc())
                .requiredQuantity(6000*bomE3.getQuantity()).purchaseUnit(bomE3.getUnit())
                .supplierName("德州仪器")
                .priceBeforeTax(65.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .plannedReceivingLocation("B02E7").plannedArrivalDate("2022-08-02").build();

        PurchaseRequireDto purchaseRequireDtoE4 = PurchaseRequireDto.builder().salesOrderNumber(orderDetailDtoH.getId())
                .salesOrderName(orderDetailDtoH.getSalesOrderName()).purchaseType(1).purchaseGroup("POO1")
                .materialNumber(bomE4.getMaterialCode()).materialName(bomE4.getMaterialName())
                .materialDescription(bomE4.getMaterialDesc())
                .requiredQuantity(6000*bomE4.getQuantity()).purchaseUnit(bomE4.getUnit())
                .supplierName("富康制造")
                .priceBeforeTax(15.0F)
                .department("采购部").applicant(faker.name().fullName())
                .workOrderNumber("W001")
                .status("2").approvalStatus(2)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .plannedReceivingLocation("B02E8").plannedArrivalDate("2022-08-02").build();

        purchaseRequireDto1.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto1));
        purchaseRequireDto2.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto2));
        purchaseRequireDto3.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto3));
        purchaseRequireDto4.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto4));
        purchaseRequireDto5.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto5));
        purchaseRequireDto6.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto6));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto1.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseService.reviewPurchaseRequire(purchaseRequireDto2.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseService.reviewPurchaseRequire(purchaseRequireDto3.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseService.reviewPurchaseRequire(purchaseRequireDto4.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseService.reviewPurchaseRequire(purchaseRequireDto5.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseService.reviewPurchaseRequire(purchaseRequireDto6.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto7.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto7));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto7.getPurchaseRequestNumber(),1,sig2);

        // 一级物料采购申请审批语句
        purchaseRequireDto01.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto01));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto01.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto02.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto02));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto02.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto03.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto03));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto03.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto04.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto04));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto04.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto05.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto05));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto05.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto06.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto06));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto06.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto07.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto07));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto07.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto08.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto08));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto08.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto09.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto09));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto09.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto010.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto010));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto010.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto011.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto011));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto011.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto012.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto012));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto012.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto013.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto013));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto013.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto014.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto014));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto014.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto015.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto015));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto015.getPurchaseRequestNumber(),1,sig1PRRV);
        purchaseRequireDto016.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDto016));
        purchaseService.reviewPurchaseRequire(purchaseRequireDto016.getPurchaseRequestNumber(),1,sig1PRRV);
        // 二级物料采购申请审批语句
        purchaseRequireDtoE1.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDtoE1));
        purchaseService.reviewPurchaseRequire(purchaseRequireDtoE1.getPurchaseRequestNumber(),1,sig4);
        purchaseRequireDtoE2.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDtoE2));
        purchaseService.reviewPurchaseRequire(purchaseRequireDtoE2.getPurchaseRequestNumber(),1,sig4);
        purchaseRequireDtoE3.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDtoE3));
        purchaseService.reviewPurchaseRequire(purchaseRequireDtoE3.getPurchaseRequestNumber(),1,sig4);
        purchaseRequireDtoE4.setPurchaseRequestNumber(purchaseService.createPurchaseRequire(purchaseRequireDtoE4));
        purchaseService.reviewPurchaseRequire(purchaseRequireDtoE4.getPurchaseRequestNumber(),1,sig4);

        // 采购合同
        PurchaseContractDto purchaseContractDto4 = makeSavePurchaseContract(purchaseRequireDto4,"COMPLETED");
        PurchaseContractDto purchaseContractDto5 = makeSavePurchaseContract(purchaseRequireDto5,"COMPLETED");
        PurchaseContractDto purchaseContractDto6 = makeSavePurchaseContract(purchaseRequireDto6,"COMPLETED");
        PurchaseContractDto purchaseContractDto1 = makeSavePurchaseContract(purchaseRequireDto1,"COMPLETED");
        PurchaseContractDto purchaseContractDto2 = makeSavePurchaseContract(purchaseRequireDto2,"COMPLETED");
        PurchaseContractDto purchaseContractDto3 = makeSavePurchaseContract(purchaseRequireDto3,"COMPLETED");
        // 采购订单
        PurchaseOrderDto purchaseOrderDto4 = makeSavePurchaseOrder(bom3, purchaseRequireDto4,
                entpAddr, purchaseContractDto4.getContractNo(), sig1PR);
        PurchaseOrderDto purchaseOrderDto5 = makeSavePurchaseOrder(bom4, purchaseRequireDto5,
                entpAddr, contractNumberG, sig1PR);
        PurchaseOrderDto purchaseOrderDto6 = makeSavePurchaseOrder(bom5, purchaseRequireDto6,
                entpAddr, purchaseContractDto6.getContractNo(), sig1PR);
        PurchaseOrderDto purchaseOrderDto1 = makeSavePurchaseOrder(bomDto1, purchaseRequireDto1,
                entpAddr, purchaseContractDto1.getContractNo(), sig1PR);
        PurchaseOrderDto purchaseOrderDto2 = makeSavePurchaseOrder(bomDto2, purchaseRequireDto2,
                entpAddr, purchaseContractDto2.getContractNo(), sig1PR);
        PurchaseOrderDto purchaseOrderDto3 = makeSavePurchaseOrder(bomDto3, purchaseRequireDto3,
                entpAddr, purchaseContractDto3.getContractNo(), sig1PR);
        PurchaseOrderDto purchaseOrderDto7 = makeSavePurchaseOrder(bom7, purchaseRequireDto7,
                entpAddr, "HT70936662869", sig4);

        // 一级物料采购订单语句
        PurchaseOrderDto purchaseOrderDto01 = makeSavePurchaseOrder(bom01, purchaseRequireDto01,
                entpAddr, "HT202207210032", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto02 = makeSavePurchaseOrder(bom02, purchaseRequireDto02,
                entpAddr, "HT202207210075", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto03 = makeSavePurchaseOrder(bom03, purchaseRequireDto03,
                entpAddr, "HT202207210119", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto04 = makeSavePurchaseOrder(bom04, purchaseRequireDto04,
                entpAddr, "HT202207210256", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto05 = makeSavePurchaseOrder(bom05, purchaseRequireDto05,
                entpAddr, "HT202207150307", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto06 = makeSavePurchaseOrder(bom06, purchaseRequireDto06,
                entpAddr, "HT202207210442", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto07 = makeSavePurchaseOrder(bom07, purchaseRequireDto07,
                entpAddr, "HT202207210523", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto08 = makeSavePurchaseOrder(bom08, purchaseRequireDto08,
                entpAddr, "HT202207210668", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto09 = makeSavePurchaseOrder(bom09, purchaseRequireDto09,
                entpAddr, "HT202207210734", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto10 = makeSavePurchaseOrder(bom010, purchaseRequireDto010,
                entpAddr, "HT202207210891", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto11 = makeSavePurchaseOrder(bom011, purchaseRequireDto011,
                entpAddr, "HT202207210956", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto12 = makeSavePurchaseOrder(bom012, purchaseRequireDto012,
                entpAddr, "HT202207211028", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto13 = makeSavePurchaseOrder(bom013, purchaseRequireDto013,
                entpAddr, "HT202207211142", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto14 = makeSavePurchaseOrder(bom014, purchaseRequireDto014,
                entpAddr, "HT202207211205", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto15 = makeSavePurchaseOrder(bom015, purchaseRequireDto015,
                entpAddr, "HT202207211379", sig1PR, "2022-07-21");
        PurchaseOrderDto purchaseOrderDto16 = makeSavePurchaseOrder(bom016, purchaseRequireDto016,
                entpAddr, "HT202207211464", sig1PR, "2022-07-21");
// 二级物料采购订单语句
        PurchaseOrderDto purchaseOrderDtoE1 = makeSavePurchaseOrder(bomE1, purchaseRequireDtoE1,
                entpAddr, "HT202208061577", sig4, "2022-08-06");
        PurchaseOrderDto purchaseOrderDtoE2 = makeSavePurchaseOrder(bomE2, purchaseRequireDtoE2,
                entpAddr, "HT202208061682", sig4, "2022-08-06");
        PurchaseOrderDto purchaseOrderDtoE3 = makeSavePurchaseOrder(bomE3, purchaseRequireDtoE3,
                entpAddr, "HT202208061739", sig4, "2022-08-06");
        PurchaseOrderDto purchaseOrderDtoE4= makeSavePurchaseOrder(bomE4, purchaseRequireDtoE4,
                entpAddr, "HT202208061824", sig4, "2022-08-06");
        // 电池公司
        // 二级物料入库语句（使用E编号）
        String prIn4name1 = faker.name().fullName();
        String prIn4phone1 = faker.phoneNumber().cellPhone();
        InboundBillDto inboundBillDtoE1 = InboundBillDto.builder().product(purchaseRequireDtoE1.getMaterialName())
                .inboundType(1)
                .bomCode(bomE1.getMaterialCode())
                .batch("BN202203070017")
                .upstream(purchaseRequireDtoE1.getSupplierName()).logistics("顺丰速运").trackingNumber("SF142876543219")
                .number(purchaseRequireDtoE1.getRequiredQuantity())
                .warehouse("B").warehouseLocation("B02").warehouseArea("02").warehousePosition("E5")
                .datetime(purchaseRequireDtoE1.getPlannedArrivalDate())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        inboundBillDtoE1 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDtoE1));

        InboundBillDto inboundBillDtoE2 = InboundBillDto.builder().product(purchaseRequireDtoE2.getMaterialName())
                .inboundType(1)
                .bomCode(bomE2.getMaterialCode())
                .batch("BN202109140018")
                .upstream(purchaseRequireDtoE2.getSupplierName()).logistics("德邦物流").trackingNumber("DB789012345678")
                .number(purchaseRequireDtoE2.getRequiredQuantity())
                .warehouse("B").warehouseLocation("B02").warehouseArea("02").warehousePosition("E6")
                .datetime(purchaseRequireDtoE2.getPlannedArrivalDate())
                .userName(sig4.getUserName())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        inboundBillDtoE2 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDtoE2));

        InboundBillDto inboundBillDtoE3 = InboundBillDto.builder().product(purchaseRequireDtoE3.getMaterialName())
                .inboundType(1)
                .bomCode(bomE3.getMaterialCode())
                .batch("BN202205140019")
                .upstream(purchaseRequireDtoE3.getSupplierName()).logistics("京东物流").trackingNumber("JD345678901234")
                .number(purchaseRequireDtoE3.getRequiredQuantity())
                .warehouse("B").warehouseLocation("B02").warehouseArea("02").warehousePosition("E7")
                .datetime(purchaseRequireDtoE3.getPlannedArrivalDate())
                .userName(sig4.getUserName())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        inboundBillDtoE3 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDtoE3));

        InboundBillDto inboundBillDtoE4 = InboundBillDto.builder().product(purchaseRequireDtoE4.getMaterialName())
                .inboundType(1)
                .bomCode(bomE4.getMaterialCode())
                .batch("BN202203110020")
                .upstream(purchaseRequireDtoE4.getSupplierName()).logistics("中通快递").trackingNumber("ZT567890123456")
                .number(purchaseRequireDtoE4.getRequiredQuantity())
                .warehouse("B").warehouseLocation("B02").warehouseArea("02").warehousePosition("E8")
                .datetime(purchaseRequireDtoE4.getPlannedArrivalDate())
                .userName(sig4.getUserName())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        inboundBillDtoE4 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDtoE4));

        InboundBillDto inboundBillDto7 = InboundBillDto.builder().product(purchaseRequireDto7.getMaterialName())
                .inboundType(1)
                .bomCode(bom7.getMaterialCode())
                .batch("BN32675548670587")
                .upstream(purchaseRequireDto7.getSupplierName()).logistics("邮政").trackingNumber("EMS47629568655678")
                .number(purchaseRequireDto7.getRequiredQuantity())
                .warehouse("Q1").warehouseLocation("C").warehouseArea("B").warehousePosition("C001")
                .datetime(purchaseRequireDto6.getPlannedArrivalDate())
                .userName(sig4.getUserName())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        inboundBillDto7 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto7));

        OutboundBillDto outboundBillDto7 = OutboundBillDto.builder().product(purchaseRequireDto7.getMaterialName())
                .outboundType(2).number(5)
                .warehouse(inboundBillDto7.getWarehouse()).warehouseLocation(inboundBillDto7.getWarehouseLocation())
                .warehouseArea(inboundBillDto7.getWarehouseArea())
                .warehousePosition(inboundBillDto7.getWarehousePosition())
                .datetime("2025-03-23").stockId(inboundBillDto7.getStockId())
                .userName(sig4.getUserName())
                .worker(prIn4name1)
                .phone(prIn4phone1)
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto7);

        // 二级物料出库语句
        OutboundBillDto outboundBillDtoE1 = OutboundBillDto.builder().product(purchaseRequireDtoE1.getMaterialName())
                .outboundType(2).number(inboundBillDtoE1.getNumber())
                .warehouse(inboundBillDtoE1.getWarehouse()).warehouseLocation(inboundBillDtoE1.getWarehouseLocation())
                .warehouseArea(inboundBillDtoE1.getWarehouseArea())
                .warehousePosition(inboundBillDtoE1.getWarehousePosition())
                .datetime("2022-08-07").stockId(inboundBillDtoE1.getStockId())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDtoE1);

        OutboundBillDto outboundBillDtoE2 = OutboundBillDto.builder().product(purchaseRequireDtoE2.getMaterialName())
                .outboundType(2).number(inboundBillDtoE2.getNumber())
                .warehouse(inboundBillDtoE2.getWarehouse()).warehouseLocation(inboundBillDtoE2.getWarehouseLocation())
                .warehouseArea(inboundBillDtoE2.getWarehouseArea())
                .warehousePosition(inboundBillDtoE2.getWarehousePosition())
                .datetime("2022-08-07").stockId(inboundBillDtoE2.getStockId())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDtoE2);

        OutboundBillDto outboundBillDtoE3 = OutboundBillDto.builder().product(purchaseRequireDtoE3.getMaterialName())
                .outboundType(2).number(inboundBillDtoE3.getNumber())
                .warehouse(inboundBillDtoE3.getWarehouse()).warehouseLocation(inboundBillDtoE3.getWarehouseLocation())
                .warehouseArea(inboundBillDtoE3.getWarehouseArea())
                .warehousePosition(inboundBillDtoE3.getWarehousePosition())
                .datetime("2022-08-07").stockId(inboundBillDtoE3.getStockId())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDtoE3);

        OutboundBillDto outboundBillDtoE4 = OutboundBillDto.builder().product(purchaseRequireDtoE4.getMaterialName())
                .outboundType(2).number(inboundBillDtoE4.getNumber())
                .batch(inboundBillDtoE1.getBatch())
                .warehouse(inboundBillDtoE4.getWarehouse()).warehouseLocation(inboundBillDtoE4.getWarehouseLocation())
                .warehouseArea(inboundBillDtoE4.getWarehouseArea())
                .warehousePosition(inboundBillDtoE4.getWarehousePosition())
                .datetime("2022-08-07").stockId(inboundBillDtoE4.getStockId())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDtoE4);

        // 电池公司
        // 合同计划工单数据
        ProductionDescDto descDto01 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto01.getId())
                .salesOrderName(orderDetailDto01.getSalesOrderName()).customerName("南京新能源科技有限公司")
                .contractNumber("HT202503140001").contractName("高能量密度动力电池销售合同")
                .deliveryDate("2025-04-20").deliveryGroupNumber("BAT001")
                .materialCode(bomF01.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto01 = ProductionScheduleDto.builder().materialCode(descDto01.getMaterialCode())
                .workOrderType(1).area("A").productionLine("B").processRoute("EA")
                .productionQuantity(0)
                .requiredQuantity(5000)
                .plannedStartDate("2025-03-25").plannedEndDate("2025-04-15")
                .actualStartDate("2025-03-25").actualEndDate("2025-04-15")
                .storageQuantity(5000).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto01 = new PlanOrderDetailDto(null, descDto01, scheduleDto01,
                null, "已完工", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto02 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto02.getId())
                .salesOrderName(orderDetailDto02.getSalesOrderName()).customerName("深圳智能设备有限公司")
                .contractNumber("HT202504150002").contractName("快充型锂离子电池销售协议")
                .deliveryDate("2025-06-30").deliveryGroupNumber("BAT002")
                .materialCode(bomF02.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto02 = ProductionScheduleDto.builder().materialCode(descDto02.getMaterialCode())
                .workOrderType(1).area("A").productionLine("C").processRoute("EA")
                .productionQuantity(4000)
                .requiredQuantity(8000)
                .plannedStartDate("2025-05-10").plannedEndDate("2025-06-20")
                .actualStartDate("2025-05-10").actualEndDate("2025-06-20")
                .storageQuantity(4000).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto02 = new PlanOrderDetailDto(null, descDto02, scheduleDto02,
                null, "进行中", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto03 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto03.getId())
                .salesOrderName(orderDetailDto03.getSalesOrderName()).customerName("北京新能源汽车股份有限公司")
                .contractNumber("HT202505200003").contractName("石墨烯复合电池批量采购合同")
                .deliveryDate("2025-07-15").deliveryGroupNumber("BAT003")
                .materialCode(bomF03.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto03 = ProductionScheduleDto.builder().materialCode(descDto03.getMaterialCode())
                .workOrderType(1).area("B").productionLine("A").processRoute("EA")
                .productionQuantity(20500)
                .requiredQuantity(20500)
                .plannedStartDate("2025-05-25").plannedEndDate("2025-07-05")
                .actualStartDate("2025-05-25").actualEndDate("2025-07-05")
                .storageQuantity(20500).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto03 = new PlanOrderDetailDto(null, descDto03, scheduleDto03,
                null, "已完工", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto04 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto04.getId())
                .salesOrderName(orderDetailDto04.getSalesOrderName()).customerName("西部矿业集团")
                .contractNumber("HT202506180004").contractName("高温型特种电池供应合同")
                .deliveryDate("2025-09-10").deliveryGroupNumber("BAT004")
                .materialCode(bomF04.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto04 = ProductionScheduleDto.builder().materialCode(descDto04.getMaterialCode())
                .workOrderType(1).area("C").productionLine("D").processRoute("EA")
                .productionQuantity(0)
                .requiredQuantity(3000)
                .plannedStartDate("2025-08-01").plannedEndDate("2025-08-31")
                .actualStartDate("").actualEndDate("")
                .storageQuantity(0).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto04 = new PlanOrderDetailDto(null, descDto04, scheduleDto04,
                null, "未开始", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto05 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto05.getId())
                .salesOrderName(orderDetailDto05.getSalesOrderName()).customerName("广东电力建设公司")
                .contractNumber("HT202507220005").contractName("储能型磷酸铁锂电池销售协议")
                .deliveryDate("2025-10-31").deliveryGroupNumber("BAT005")
                .materialCode(bomF05.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto05 = ProductionScheduleDto.builder().materialCode(descDto05.getMaterialCode())
                .workOrderType(1).area("A").productionLine("B").processRoute("EA")
                .productionQuantity(6000)
                .requiredQuantity(10000)
                .plannedStartDate("2025-08-15").plannedEndDate("2025-10-20")
                .actualStartDate("2025-08-15").actualEndDate("2025-10-20")
                .storageQuantity(6000).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto05 = new PlanOrderDetailDto(null, descDto05, scheduleDto05,
                null, "进行中", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto06 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto06.getId())
                .salesOrderName(orderDetailDto06.getSalesOrderName()).customerName("杭州无人机科技有限公司")
                .contractNumber("HT202508050006").contractName("微型无人机专用电池采购合同")
                .deliveryDate("2025-09-25").deliveryGroupNumber("BAT006")
                .materialCode(bomF06.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto06 = ProductionScheduleDto.builder().materialCode(descDto06.getMaterialCode())
                .workOrderType(1).area("D").productionLine("E").processRoute("EA")
                .productionQuantity(15300)
                .requiredQuantity(15300)
                .plannedStartDate("2025-08-10").plannedEndDate("2025-09-15")
                .actualStartDate("2025-08-10").actualEndDate("2025-09-15")
                .storageQuantity(15300).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto06 = new PlanOrderDetailDto(null, descDto06, scheduleDto06,
                null, "已完工", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto07 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto07.getId())
                .salesOrderName(orderDetailDto07.getSalesOrderName()).customerName("上海医疗器械有限公司")
                .contractNumber("HT202509120007").contractName("医疗设备专用电池供应协议")
                .deliveryDate("2025-11-20").deliveryGroupNumber("BAT007")
                .materialCode(bomF07.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto07 = ProductionScheduleDto.builder().materialCode(descDto07.getMaterialCode())
                .workOrderType(1).area("B").productionLine("C").processRoute("EA")
                .productionQuantity(2000)
                .requiredQuantity(5000)
                .plannedStartDate("2025-09-20").plannedEndDate("2025-11-10")
                .actualStartDate("2025-09-20").actualEndDate("2025-11-10")
                .storageQuantity(2000).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto07 = new PlanOrderDetailDto(null, descDto07, scheduleDto07,
                null, "进行中", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto08 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto08.getId())
                .salesOrderName(orderDetailDto08.getSalesOrderName()).customerName("大连船舶制造有限公司")
                .contractNumber("HT202510080008").contractName("船舶用高安全电池销售合同")
                .deliveryDate("2025-12-15").deliveryGroupNumber("BAT008")
                .materialCode(bomF08.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto08 = ProductionScheduleDto.builder().materialCode(descDto08.getMaterialCode())
                .workOrderType(1).area("C").productionLine("D").processRoute("EA")
                .productionQuantity(0)
                .requiredQuantity(2000)
                .plannedStartDate("2025-10-20").plannedEndDate("2025-12-05")
                .actualStartDate("").actualEndDate("")
                .storageQuantity(0).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto08 = new PlanOrderDetailDto(null, descDto08, scheduleDto08,
                null, "未开始", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto09 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto09.getId())
                .salesOrderName(orderDetailDto09.getSalesOrderName()).customerName("东莞电子制造有限公司")
                .contractNumber("HT202511150009").contractName("消费电子标准电池批量订单")
                .deliveryDate("2026-01-10").deliveryGroupNumber("BAT009")
                .materialCode(bomF09.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto09 = ProductionScheduleDto.builder().materialCode(descDto09.getMaterialCode())
                .workOrderType(1).area("A").productionLine("A").processRoute("EA")
                .productionQuantity(51000)
                .requiredQuantity(51000)
                .plannedStartDate("2025-11-20").plannedEndDate("2025-12-30")
                .actualStartDate("2025-11-20").actualEndDate("2025-12-30")
                .storageQuantity(51000).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto09 = new PlanOrderDetailDto(null, descDto09, scheduleDto09,
                null, "已完工", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        ProductionDescDto descDto10 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto10.getId())
                .salesOrderName(orderDetailDto10.getSalesOrderName()).customerName("成都航空航天研究所")
                .contractNumber("HT202512200010").contractName("航空航天特种电池供应合同")
                .deliveryDate("2026-02-28").deliveryGroupNumber("BAT010")
                .materialCode(bomF10.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto10 = ProductionScheduleDto.builder().materialCode(descDto10.getMaterialCode())
                .workOrderType(1).area("E").productionLine("F").processRoute("EA")
                .productionQuantity(400)
                .requiredQuantity(1000)
                .plannedStartDate("2025-12-25").plannedEndDate("2026-02-20")
                .actualStartDate("2025-12-25").actualEndDate("2026-02-20")
                .storageQuantity(400).storageLocation("MAIN")
                .build();
        PlanOrderDetailDto detailDto10 = new PlanOrderDetailDto(null, descDto10, scheduleDto10,
                null, "进行中", null,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());
        //
        // 电子加工合同计划工单数据
        ProductionDescDto descDto11 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto11.getId())
                .salesOrderName(orderDetailDto11.getSalesOrderName()).customerName("盛为技术有限公司")
                .contractNumber("HT202503200011").contractName("智能手机主板加工合同")
                .deliveryDate("2025-05-15").deliveryGroupNumber("PCB001")
                .materialCode(bomF11.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto11 = ProductionScheduleDto.builder().materialCode(descDto11.getMaterialCode())
                .workOrderType(1).area("SMT").productionLine("L01").processRoute("SMTProcess")
                .productionQuantity(50500)
                .requiredQuantity(50500)
                .plannedStartDate("2025-03-25").plannedEndDate("2025-05-10")
                .actualStartDate("2025-03-25").actualEndDate("2025-05-10")
                .storageQuantity(50500).storageLocation("FINISHED_GOODS")
                .build();
        PlanOrderDetailDto detailDto11 = new PlanOrderDetailDto(null, descDto11, scheduleDto11,
                null, "已完工", null,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        ProductionDescDto descDto12 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto12.getId())
                .salesOrderName(orderDetailDto12.getSalesOrderName()).customerName("正良科技有限责任公司")
                .contractNumber("HT202504250012").contractName("智能手表PCBA加工协议")
                .deliveryDate("2025-07-20").deliveryGroupNumber("PCB002")
                .materialCode(bomF12.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto12 = ProductionScheduleDto.builder().materialCode(descDto12.getMaterialCode())
                .workOrderType(1).area("SMT").productionLine("L02").processRoute("FPCProcess")
                .productionQuantity(60000)
                .requiredQuantity(100000)
                .plannedStartDate("2025-05-05").plannedEndDate("2025-07-15")
                .actualStartDate("2025-05-05").actualEndDate("2025-07-15")
                .storageQuantity(60000).storageLocation("FINISHED_GOODS")
                .build();
        PlanOrderDetailDto detailDto12 = new PlanOrderDetailDto(null, descDto12, scheduleDto12,
                null, "进行中", null,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        ProductionDescDto descDto13 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto13.getId())
                .salesOrderName(orderDetailDto13.getSalesOrderName()).customerName("浙江中控技术股份有限公司")
                .contractNumber("HT202506150013").contractName("工业控制板卡加工合同")
                .deliveryDate("2025-08-30").deliveryGroupNumber("PCB003")
                .materialCode(bomF13.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto13 = ProductionScheduleDto.builder().materialCode(descDto13.getMaterialCode())
                .workOrderType(1).area("DIP").productionLine("L03").processRoute("HeavyCopperProcess")
                .productionQuantity(20200)
                .requiredQuantity(20200)
                .plannedStartDate("2025-06-20").plannedEndDate("2025-08-25")
                .actualStartDate("2025-06-20").actualEndDate("2025-08-25")
                .storageQuantity(20200).storageLocation("FINISHED_GOODS")
                .build();
        PlanOrderDetailDto detailDto13 = new PlanOrderDetailDto(null, descDto13, scheduleDto13,
                null, "已完工", null,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        ProductionDescDto descDto14 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto14.getId())
                .salesOrderName(orderDetailDto14.getSalesOrderName()).customerName("优奔股份有限公司")
                .contractNumber("HT202508080014").contractName("汽车电子控制单元加工协议")
                .deliveryDate("2025-11-15").deliveryGroupNumber("PCB004")
                .materialCode(bomF14.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto14 = ProductionScheduleDto.builder().materialCode(descDto14.getMaterialCode())
                .workOrderType(1).area("SMT").productionLine("L04").processRoute("AutoGradeProcess")
                .productionQuantity(25000)
                .requiredQuantity(50000)
                .plannedStartDate("2025-08-20").plannedEndDate("2025-11-05")
                .actualStartDate("2025-08-20").actualEndDate("2025-11-05")
                .storageQuantity(25000).storageLocation("FINISHED_GOODS")
                .build();
        PlanOrderDetailDto detailDto14 = new PlanOrderDetailDto(null, descDto14, scheduleDto14,
                null, "进行中", null,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        ProductionDescDto descDto15 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(orderDetailDto15.getId())
                .salesOrderName(orderDetailDto15.getSalesOrderName()).customerName("迈瑞医疗国际有限公司")
                .contractNumber("HT202510120015").contractName("医疗设备主板加工合同")
                .deliveryDate("2026-01-20").deliveryGroupNumber("PCB005")
                .materialCode(bomF15.getMaterialCode()).build();

        ProductionScheduleDto scheduleDto15 = ProductionScheduleDto.builder().materialCode(descDto15.getMaterialCode())
                .workOrderType(1).area("SMT").productionLine("L05").processRoute("MedicalGradeProcess")
                .productionQuantity(0)
                .requiredQuantity(15000)
                .plannedStartDate("2025-10-25").plannedEndDate("2026-01-10")
                .actualStartDate("").actualEndDate("")
                .storageQuantity(0).storageLocation("FINISHED_GOODS")
                .build();
        PlanOrderDetailDto detailDto15 = new PlanOrderDetailDto(null, descDto15, scheduleDto15,
                null, "未开始", null,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());
        //

        ContractDto co3 = contractDtoH;
        OrderDetailDto so3 = orderDetailDtoH;
        ProductionDescDto descDto3 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(so3.getId())
                .salesOrderName(so3.getSalesOrderName()).customerName(co3.getCustomerName())
                .contractNumber(co3.getContractNumber()).contractName(co3.getContractName())
                .deliveryDate(co3.getRequiredDeliveryDate()).deliveryGroupNumber(co3.getProductGroup())
                .materialCode(co3.getDeliverable().get(0).getMaterialNumber()).build();

        ProductionScheduleDto scheduleDto3 = ProductionScheduleDto.builder().materialCode(descDto3.getMaterialCode())
                .workOrderType(1).area("S").productionLine("C").processRoute("EA")
                .productionQuantity(0)
                .requiredQuantity(6000)
                .plannedStartDate("2022-08-07").plannedEndDate("2022-08-07")
                .actualStartDate("2022-08-07").actualEndDate("2022-08-07")
                .storageQuantity(6000).storageLocation("MAIN")
                .build();

        List<BOMInfoDto> bomInfoDtos3 = new ArrayList<>();
        List<MaterialInfoDto> materialInfoDtos3 = new ArrayList<>();
        List<BOMDto> bomDtos3 = designService.getBOMsByOrder(inboundBillDtoE1.getStockId());
        bomDtos3.addAll(designService.getBOMsByOrder(inboundBillDtoE2.getStockId()));
        bomDtos3.addAll(designService.getBOMsByOrder(inboundBillDtoE3.getStockId()));
        bomDtos3.addAll(designService.getBOMsByOrder(inboundBillDtoE4.getStockId()));
        for (BOMDto designBom:
                bomDtos3) {
            BOMInfoDto bomInfo = BOMInfoDto.builder()
                    .materialCode(designBom.getMaterialCode())
                    .materialName(designBom.getMaterialName())
                    .materialDesc(designBom.getMaterialDesc())
                    .quantity(designBom.getQuantity())
                    .manufacturer(designBom.getManufacturer())
                    .substituteType(1).unit(designBom.getUnit())
                    .build();
            bomInfoDtos3.add(bomInfo);
            MaterialInfoDto matInfo = MaterialInfoDto.builder()
                    .kitStatus(0).materialCode(bomInfo.getMaterialCode())
                    .materialName(bomInfo.getMaterialName())
                    .materialDesc(bomInfo.getMaterialDesc())
                    .unit(bomInfo.getUnit())
                    .issueType(1)
                    .receivedQuantity(bomInfo.getQuantity())
                    .consumedQuantity(bomInfo.getQuantity())
                    .unreceivedQuantity(0).availableQuantity(0)
                    .shortageQuantity(0).plannedArrivalDate("2022-08-07")
                    .actualArrivalDate("2022-08-07").build();
            materialInfoDtos3.add(matInfo);
        }
        List<MatchingPlanDto> matchingPlanDtos3 = new ArrayList<>();
        matchingPlanDtos3.add(new MatchingPlanDto("标准装配方案","标准电子产品装配流程", true));
        matchingPlanDtos3.add(new MatchingPlanDto("紧急生产方案", "紧急订单优先生产流程", false));
        matchingPlanDtos3.add(new MatchingPlanDto("小量试产方案", "新产品小批量试产流程", false));
        PreparationDto preparationDto3 = new PreparationDto(bomInfoDtos3,materialInfoDtos3,matchingPlanDtos3);

        List<SettleRuleDto> settleRuleDtos3 = Arrays.asList(
                new SettleRuleDto("1","仓库",90,"1"),
                new SettleRuleDto("1","质检部",10,"1"));

        CostInfoDto costInfoDto3 = new CostInfoDto(new CostCalcDto(), settleRuleDtos3);

        PlanOrderDetailDto detailDto3 = new PlanOrderDetailDto(null, descDto3, scheduleDto3,
                preparationDto3, "未完工", costInfoDto3,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        String mo3 = planService.createPlanOrder(detailDto3);
        PlanOrderDetailDto planOrderDetailDto3 = planService.getPlanOrderDetail(mo3);

        String mo01 = planService.createPlanOrder(detailDto01);
        String mo02 = planService.createPlanOrder(detailDto02);
        String mo03 = planService.createPlanOrder(detailDto03);
        String mo04 = planService.createPlanOrder(detailDto04);
        String mo05 = planService.createPlanOrder(detailDto05);
        String mo06 = planService.createPlanOrder(detailDto06);
        String mo07 = planService.createPlanOrder(detailDto07);
        String mo08 = planService.createPlanOrder(detailDto08);
        String mo09 = planService.createPlanOrder(detailDto09);
        String mo10 = planService.createPlanOrder(detailDto10);
        String mo11 = planService.createPlanOrder(detailDto11);
        String mo12 = planService.createPlanOrder(detailDto12);
        String mo13 = planService.createPlanOrder(detailDto13);
        String mo14 = planService.createPlanOrder(detailDto14);
        String mo15 = planService.createPlanOrder(detailDto15);

        ProductionWorkorderDto productionWorkorderDto3 = ProductionWorkorderDto.builder()
                .planOrderNo(planOrderDetailDto3.getWorkOrderNumber())
                .materialCode(planOrderDetailDto3.getProductionDesc().getMaterialCode())
                .materialName(bomE0.getMaterialName())
                .materialDesc(bomE0.getMaterialDesc())
                .workOrderQuantity(scheduleDto3.getRequiredQuantity())
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("precisionProcess")
                .plannedStartDate("2022-08-07")
                .plannedEndDate("2022-08-07")
                .workOrderType(1).priority(1).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        String woNo3 = productionService.createProductionWorkorder(productionWorkorderDto3);
        productionWorkorderDto3.setWorkOrderNo(woNo3);

        //
        // 生产工单数据
        ProductionWorkorderDto pwo01 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto01.getWorkOrderNumber())
                .materialCode(bomF01.getMaterialCode())
                .materialName(bomF01.getMaterialName())
                .materialDesc(bomF01.getMaterialDesc())
                .workOrderQuantity(bomF01.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("precisionProcess")
                .plannedStartDate("2025-03-25")
                .plannedEndDate("2025-04-15")
                .workOrderType(1).priority(1).reportedQuantity(bomF01.getQuantity())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo02 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto02.getWorkOrderNumber())
                .materialCode(bomF02.getMaterialCode())
                .materialName(bomF02.getMaterialName())
                .materialDesc(bomF02.getMaterialDesc())
                .workOrderQuantity(bomF02.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL002").processRoute("precisionProcess")
                .plannedStartDate("2025-05-10")
                .plannedEndDate("2025-06-20")
                .workOrderType(1).priority(2).reportedQuantity(4000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo03 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto03.getWorkOrderNumber())
                .materialCode(bomF03.getMaterialCode())
                .materialName(bomF03.getMaterialName())
                .materialDesc(bomF03.getMaterialDesc())
                .workOrderQuantity(bomF03.getQuantity())
                .area("B001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("precisionProcess")
                .plannedStartDate("2025-05-25")
                .plannedEndDate("2025-07-05")
                .workOrderType(1).priority(1).reportedQuantity(bomF03.getQuantity())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo04 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto04.getWorkOrderNumber())
                .materialCode(bomF04.getMaterialCode())
                .materialName(bomF04.getMaterialName())
                .materialDesc(bomF04.getMaterialDesc())
                .workOrderQuantity(bomF04.getQuantity())
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL004").processRoute("standardProcess")
                .plannedStartDate("2025-08-01")
                .plannedEndDate("2025-08-31")
                .workOrderType(1).priority(3).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo05 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto05.getWorkOrderNumber())
                .materialCode(bomF05.getMaterialCode())
                .materialName(bomF05.getMaterialName())
                .materialDesc(bomF05.getMaterialDesc())
                .workOrderQuantity(bomF05.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("precisionProcess")
                .plannedStartDate("2025-08-15")
                .plannedEndDate("2025-10-20")
                .workOrderType(1).priority(2).reportedQuantity(6000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo06 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto06.getWorkOrderNumber())
                .materialCode(bomF06.getMaterialCode())
                .materialName(bomF06.getMaterialName())
                .materialDesc(bomF06.getMaterialDesc())
                .workOrderQuantity(bomF06.getQuantity())
                .area("D001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("standardProcess")
                .plannedStartDate("2025-08-10")
                .plannedEndDate("2025-09-15")
                .workOrderType(1).priority(1).reportedQuantity(bomF06.getQuantity())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo07 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto07.getWorkOrderNumber())
                .materialCode(bomF07.getMaterialCode())
                .materialName(bomF07.getMaterialName())
                .materialDesc(bomF07.getMaterialDesc())
                .workOrderQuantity(bomF07.getQuantity())
                .area("B001")
                .referenceDocType("0")
                .productionLine("PL004").processRoute("precisionProcess")
                .plannedStartDate("2025-09-20")
                .plannedEndDate("2025-11-10")
                .workOrderType(1).priority(2).reportedQuantity(2000)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo08 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto08.getWorkOrderNumber())
                .materialCode(bomF08.getMaterialCode())
                .materialName(bomF08.getMaterialName())
                .materialDesc(bomF08.getMaterialDesc())
                .workOrderQuantity(bomF08.getQuantity())
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("precisionProcess")
                .plannedStartDate("2025-10-20")
                .plannedEndDate("2025-12-05")
                .workOrderType(1).priority(3).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo09 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto09.getWorkOrderNumber())
                .materialCode(bomF09.getMaterialCode())
                .materialName(bomF09.getMaterialName())
                .materialDesc(bomF09.getMaterialDesc())
                .workOrderQuantity(bomF09.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("standardProcess")
                .plannedStartDate("2025-11-20")
                .plannedEndDate("2025-12-30")
                .workOrderType(1).priority(1).reportedQuantity(bomF09.getQuantity())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        ProductionWorkorderDto pwo10 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto10.getWorkOrderNumber())
                .materialCode(bomF10.getMaterialCode())
                .materialName(bomF10.getMaterialName())
                .materialDesc(bomF10.getMaterialDesc())
                .workOrderQuantity(bomF10.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL002").processRoute("precisionProcess")
                .plannedStartDate("2025-12-25")
                .plannedEndDate("2026-02-20")
                .workOrderType(1).priority(1).reportedQuantity(400)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        //
        // 电子加工生产工单数据
        ProductionWorkorderDto pwo11 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto11.getWorkOrderNumber())
                .materialCode(bomF11.getMaterialCode())
                .materialName(bomF11.getMaterialName())
                .materialDesc(bomF11.getMaterialDesc())
                .workOrderQuantity(bomF11.getQuantity())
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("standardProcess")
                .plannedStartDate("2025-03-25")
                .plannedEndDate("2025-05-10")
                .workOrderType(1).priority(1).reportedQuantity(bomF11.getQuantity())
                .userName(sig1.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo12 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto12.getWorkOrderNumber())
                .materialCode(bomF12.getMaterialCode())
                .materialName(bomF12.getMaterialName())
                .materialDesc(bomF12.getMaterialDesc())
                .workOrderQuantity(bomF12.getQuantity())
                .area("B001")
                .referenceDocType("0")
                .productionLine("PL002").processRoute("standardProcess")
                .plannedStartDate("2025-05-05")
                .plannedEndDate("2025-07-15")
                .workOrderType(1).priority(2).reportedQuantity(60000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo13 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto13.getWorkOrderNumber())
                .materialCode(bomF13.getMaterialCode())
                .materialName(bomF13.getMaterialName())
                .materialDesc(bomF13.getMaterialDesc())
                .workOrderQuantity(bomF13.getQuantity())
                .area("D001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("standardProcess")
                .plannedStartDate("2025-06-20")
                .plannedEndDate("2025-08-25")
                .workOrderType(1).priority(1).reportedQuantity(bomF13.getQuantity())
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo14 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto14.getWorkOrderNumber())
                .materialCode(bomF14.getMaterialCode())
                .materialName(bomF14.getMaterialName())
                .materialDesc(bomF14.getMaterialDesc())
                .workOrderQuantity(bomF14.getQuantity())
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL004").processRoute("standardProcess")
                .plannedStartDate("2025-08-20")
                .plannedEndDate("2025-11-05")
                .workOrderType(1).priority(1).reportedQuantity(25000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo15 = ProductionWorkorderDto.builder()
                .planOrderNo(detailDto15.getWorkOrderNumber())
                .materialCode(bomF15.getMaterialCode())
                .materialName(bomF15.getMaterialName())
                .materialDesc(bomF15.getMaterialDesc())
                .workOrderQuantity(bomF15.getQuantity())
                .area("B001")
                .referenceDocType("0")
                .productionLine("PL004").processRoute("standardProcess")
                .plannedStartDate("2025-10-25")
                .plannedEndDate("2026-01-10")
                .workOrderType(1).priority(3).reportedQuantity(0)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();
        // 随机产品生产工单数据
        ProductionWorkorderDto pwo16 = ProductionWorkorderDto.builder()
                .planOrderNo("PO202503200016")
                .materialCode("LED-DISPLAY-001")
                .materialName("高清LED显示屏")
                .materialDesc("55英寸4K超高清LED显示屏，HDR技术，超薄边框设计")
                .workOrderQuantity(2000)
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("standardProcess")
                .plannedStartDate("2025-04-01")
                .plannedEndDate("2025-05-15")
                .workOrderType(1).priority(1).reportedQuantity(2000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo17 = ProductionWorkorderDto.builder()
                .planOrderNo("PO202504150017")
                .materialCode("POWER-ADAPTER-002")
                .materialName("氮化镓快充电源适配器")
                .materialDesc("65W氮化镓快充头，多协议兼容，折叠插脚设计")
                .workOrderQuantity(50000)
                .area("D001")
                .referenceDocType("0")
                .productionLine("PL002").processRoute("standardProcess")
                .plannedStartDate("2025-05-10")
                .plannedEndDate("2025-07-20")
                .workOrderType(1).priority(2).reportedQuantity(30000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo18 = ProductionWorkorderDto.builder()
                .planOrderNo("PO202506080018")
                .materialCode("SMART-SPEAKER-003")
                .materialName("智能语音音箱")
                .materialDesc("AI语音助手，360°环绕音效，WiFi/蓝牙双模连接")
                .workOrderQuantity(15000)
                .area("A001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("standardProcess")
                .plannedStartDate("2025-06-20")
                .plannedEndDate("2025-08-30")
                .workOrderType(1).priority(1).reportedQuantity(15000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo19 = ProductionWorkorderDto.builder()
                .planOrderNo("PO202508120019")
                .materialCode("WEARABLE-BAND-004")
                .materialName("智能手环")
                .materialDesc("心率监测，血氧检测，IP68防水，15天续航")
                .workOrderQuantity(80000)
                .area("B001")
                .referenceDocType("0")
                .productionLine("PL003").processRoute("precisionProcess")
                .plannedStartDate("2025-08-25")
                .plannedEndDate("2025-10-31")
                .workOrderType(1).priority(2).reportedQuantity(40000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionWorkorderDto pwo20 = ProductionWorkorderDto.builder()
                .planOrderNo("PO202510200020")
                .materialCode("ROBOT-VACUUM-005")
                .materialName("扫地机器人")
                .materialDesc("激光导航，自动集尘，拖扫一体，APP远程控制")
                .workOrderQuantity(10000)
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL001").processRoute("precisionProcess")
                .plannedStartDate("2025-11-01")
                .plannedEndDate("2026-01-15")
                .workOrderType(1).priority(1).reportedQuantity(0)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();
        //
        productionService.createProductionWorkorder(pwo01);
        productionService.createProductionWorkorder(pwo02);
        productionService.createProductionWorkorder(pwo03);
        productionService.createProductionWorkorder(pwo04);
        productionService.createProductionWorkorder(pwo05);
        productionService.createProductionWorkorder(pwo06);
        productionService.createProductionWorkorder(pwo07);
        productionService.createProductionWorkorder(pwo08);
        productionService.createProductionWorkorder(pwo09);
        productionService.createProductionWorkorder(pwo10);
        String wo11 = productionService.createProductionWorkorder(pwo11);
        String wo12 = productionService.createProductionWorkorder(pwo12);
        String wo13 = productionService.createProductionWorkorder(pwo13);
        String wo14 = productionService.createProductionWorkorder(pwo14);
        String wo15 = productionService.createProductionWorkorder(pwo15);
        productionService.createProductionWorkorder(pwo16);
        productionService.createProductionWorkorder(pwo17);
        productionService.createProductionWorkorder(pwo18);
        productionService.createProductionWorkorder(pwo19);
        productionService.createProductionWorkorder(pwo20);
        //
// 主板产品设备排程数据
        ProductionSchedulingDto psc11 = ProductionSchedulingDto.builder().workOrderStatus("completed")
                .batchNumber("BN202503250011")
                .equipmentNo("SMT-001").equipmentName("高速贴片机SMT-001").area(pwo11.getArea())
                .productionLine(pwo11.getProductionLine()).processRoute(pwo11.getProcessRoute())
                .workOrderNo(wo11).workOrderLineNo("001")
                .materialCode(pwo11.getMaterialCode()).materialName(pwo11.getMaterialName())
                .materialDesc(pwo11.getMaterialDesc()).scheduledStartDate(pwo11.getPlannedStartDate())
                .scheduledEndDate(pwo11.getPlannedEndDate())
                .createTime(pwo11.getPlannedStartDate())
                .scheduledQuantity(50500).reportedQuantity(50500)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionSchedulingDto psc12 = ProductionSchedulingDto.builder().workOrderStatus("completed")
                .batchNumber("BN202505050012")
                .equipmentNo("SMT-002").equipmentName("精密贴片机SMT-002").area(pwo12.getArea())
                .productionLine(pwo12.getProductionLine()).processRoute(pwo12.getProcessRoute())
                .workOrderNo(wo12).workOrderLineNo("001")
                .materialCode(pwo12.getMaterialCode()).materialName(pwo12.getMaterialName())
                .materialDesc(pwo12.getMaterialDesc()).scheduledStartDate(pwo12.getPlannedStartDate())
                .scheduledEndDate(pwo12.getPlannedEndDate())
                .createTime(pwo12.getPlannedStartDate())
                .scheduledQuantity(100000).reportedQuantity(60000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionSchedulingDto psc13 = ProductionSchedulingDto.builder().workOrderStatus("completed")
                .batchNumber("BN202506200013")
                .equipmentNo("DIP-001").equipmentName("自动插件机DIP-001").area(pwo13.getArea())
                .productionLine(pwo13.getProductionLine()).processRoute(pwo13.getProcessRoute())
                .workOrderNo(wo13).workOrderLineNo("001")
                .materialCode(pwo13.getMaterialCode()).materialName(pwo13.getMaterialName())
                .materialDesc(pwo13.getMaterialDesc()).scheduledStartDate(pwo13.getPlannedStartDate())
                .scheduledEndDate(pwo13.getPlannedEndDate())
                .createTime(pwo13.getPlannedStartDate())
                .scheduledQuantity(20200).reportedQuantity(20200)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionSchedulingDto psc14 = ProductionSchedulingDto.builder().workOrderStatus("completed")
                .batchNumber("BN202508200014")
                .equipmentNo("SMT-003").equipmentName("汽车贴片机SMT-003").area(pwo14.getArea())
                .productionLine(pwo14.getProductionLine()).processRoute(pwo14.getProcessRoute())
                .workOrderNo(wo14).workOrderLineNo("001")
                .materialCode(pwo14.getMaterialCode()).materialName(pwo14.getMaterialName())
                .materialDesc(pwo14.getMaterialDesc()).scheduledStartDate(pwo14.getPlannedStartDate())
                .scheduledEndDate(pwo14.getPlannedEndDate())
                .createTime(pwo14.getPlannedStartDate())
                .scheduledQuantity(50000).reportedQuantity(25000)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();

        ProductionSchedulingDto psc15 = ProductionSchedulingDto.builder().workOrderStatus("completed")
                .batchNumber("BN202510250015")
                .equipmentNo("SMT-004").equipmentName("医疗贴片机SMT-004").area(pwo15.getArea())
                .productionLine(pwo15.getProductionLine()).processRoute(pwo15.getProcessRoute())
                .workOrderNo(wo15).workOrderLineNo("001")
                .materialCode(pwo15.getMaterialCode()).materialName(pwo15.getMaterialName())
                .materialDesc(pwo15.getMaterialDesc()).scheduledStartDate(pwo15.getPlannedStartDate())
                .scheduledEndDate(pwo15.getPlannedEndDate())
                .createTime(pwo15.getPlannedStartDate())
                .scheduledQuantity(15000).reportedQuantity(0)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();
        productionService.createProductionScheduling(psc11);
        productionService.createProductionScheduling(psc12);
        productionService.createProductionScheduling(psc13);
        productionService.createProductionScheduling(psc14);
        productionService.createProductionScheduling(psc15);
        //

        BOMDto poBom3 = designService.getBOMByCode(productionWorkorderDto3.getMaterialCode());
        ProductionSchedulingDto productionSchedulingDto3_1  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("BNC3566-0004").equipmentName("覆镀成型"+ "BNC3566-0004").area(productionWorkorderDto3.getArea())
                .productionLine(productionWorkorderDto3.getProductionLine())
                .processRoute(productionWorkorderDto3.getProcessRoute())
                .workOrderNo(productionWorkorderDto3.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto3.getWorkOrderLineNo())
                .materialCode(poBom3.getMaterialCode()).materialName(poBom3.getMaterialName())
                .materialDesc(poBom3.getMaterialDesc()).scheduledStartDate(productionWorkorderDto3.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto3.getPlannedEndDate())
                .createTime(productionWorkorderDto3.getPlannedStartDate())
                .scheduledQuantity(1200).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        Long id = productionService.createProductionScheduling(productionSchedulingDto3_1);
        productionSchedulingDto3_1.setId(String.valueOf(id));
        productionSchedulingDto3_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto3_1.getId()));
        productionSchedulingDto3_1 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto3_1.getId()));
        ProductionSchedulingDto productionSchedulingDto3_2  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("BNC3566-0005").equipmentName("覆镀成型"+ "BNC3566-0005").area(productionWorkorderDto3.getArea())
                .productionLine(productionWorkorderDto3.getProductionLine()).processRoute(productionWorkorderDto3.getProcessRoute())
                .workOrderNo(productionWorkorderDto3.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto3.getWorkOrderLineNo())
                .materialCode(poBom3.getMaterialCode()).materialName(poBom3.getMaterialName())
                .materialDesc(poBom3.getMaterialDesc()).scheduledStartDate(productionWorkorderDto3.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto3.getPlannedEndDate())
                .createTime(productionWorkorderDto3.getPlannedStartDate())
                .scheduledQuantity(1200).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto3_2);
        productionSchedulingDto3_2.setId(String.valueOf(id));
        productionSchedulingDto3_2 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto3_2.getId()));
        productionSchedulingDto3_2 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto3_2.getId()));
        ProductionSchedulingDto productionSchedulingDto3_3  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("BNC3566-0007").equipmentName("覆镀成型"+ "BNC3566-0007").area(productionWorkorderDto3.getArea())
                .productionLine(productionWorkorderDto3.getProductionLine()).processRoute(productionWorkorderDto3.getProcessRoute())
                .workOrderNo(productionWorkorderDto3.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto3.getWorkOrderLineNo())
                .materialCode(poBom3.getMaterialCode()).materialName(poBom3.getMaterialName())
                .materialDesc(poBom3.getMaterialDesc()).scheduledStartDate(productionWorkorderDto3.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto3.getPlannedEndDate())
                .createTime(productionWorkorderDto3.getPlannedStartDate())
                .scheduledQuantity(1200).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto3_3);
        productionSchedulingDto3_3.setId(String.valueOf(id));
        productionSchedulingDto3_3 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto3_3.getId()));
        productionSchedulingDto3_3 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto3_3.getId()));
        ProductionSchedulingDto productionSchedulingDto3_4  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("BNC3566-0009").equipmentName("覆镀成型"+ "BNC3566-0009").area(productionWorkorderDto3.getArea())
                .productionLine(productionWorkorderDto3.getProductionLine()).processRoute(productionWorkorderDto3.getProcessRoute())
                .workOrderNo(productionWorkorderDto3.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto3.getWorkOrderLineNo())
                .materialCode(poBom3.getMaterialCode()).materialName(poBom3.getMaterialName())
                .materialDesc(poBom3.getMaterialDesc()).scheduledStartDate(productionWorkorderDto3.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto3.getPlannedEndDate())
                .createTime(productionWorkorderDto3.getPlannedStartDate())
                .scheduledQuantity(1200).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto3_4);
        productionSchedulingDto3_4.setId(String.valueOf(id));
        productionSchedulingDto3_4 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto3_4.getId()));
        productionSchedulingDto3_4 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto3_4.getId()));
        ProductionSchedulingDto productionSchedulingDto3_5  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("BNC3566-0010").equipmentName("覆镀成型"+ "BNC3566-0010").area(productionWorkorderDto3.getArea())
                .productionLine(productionWorkorderDto3.getProductionLine()).processRoute(productionWorkorderDto3.getProcessRoute())
                .workOrderNo(productionWorkorderDto3.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto3.getWorkOrderLineNo())
                .materialCode(poBom3.getMaterialCode()).materialName(poBom3.getMaterialName())
                .materialDesc(poBom3.getMaterialDesc()).scheduledStartDate(productionWorkorderDto3.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto3.getPlannedEndDate())
                .createTime(productionWorkorderDto3.getPlannedStartDate())
                .scheduledQuantity(1200).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto3_5);
        productionSchedulingDto3_5.setId(String.valueOf(id));
        productionSchedulingDto3_5 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto3_5.getId()));
        productionSchedulingDto3_5 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto3_5.getId()));

//        productionService.reportToWorkOrder(productionSchedulingDto3_1);
//        productionService.reportToWorkOrder(productionSchedulingDto3_2);
//        productionService.reportToWorkOrder(productionSchedulingDto3_3);
//        productionService.reportToWorkOrder(productionSchedulingDto3_4);
//        productionService.reportToWorkOrder(productionSchedulingDto3_5);
        productionService.finishWorkOrder(productionWorkorderDto3.getWorkOrderNo());
        productionWorkorderDto3 = productionService.getByIdProductionWorkorder(productionWorkorderDto3.getWorkOrderNo());
//        planService.reportToPlanOrder(productionWorkorderDto3);
//        planService.finishPlanOrder(planOrderDetailDto3.getWorkOrderNumber(), "COMPLETED");


        InboundBillDto prodInboundDto3_1 = new InboundBillDto();
        InboundBillDto prodInboundDto3_2 = new InboundBillDto();
        InboundBillDto prodInboundDto3_3 = new InboundBillDto();
        InboundBillDto prodInboundDto3_4 = new InboundBillDto();
        InboundBillDto prodInboundDto3_5 = new InboundBillDto();
        List<InboundBillDto> batteryProdInboundList = Arrays.asList(prodInboundDto3_1, prodInboundDto3_2,
                prodInboundDto3_3, prodInboundDto3_4, prodInboundDto3_5);

        String in4worker = faker.name().fullName();
        String in4workerPhone = faker.phoneNumber().phoneNumber();

        for (InboundBillDto pIn:
             batteryProdInboundList) {
            pIn.setProduct(bomE0.getMaterialName());
            pIn.setInboundType(2);
//                    .batch(productionSchedulingDto3_1.getBatchNumber())
            pIn.setBomCode(bomE0.getMaterialCode());
            pIn.setUpstream(sig4.getEnterpriseName());
            pIn.setNumber(1200);
            pIn.setWarehouse("D");
            pIn.setWarehouseLocation("D06");
            pIn.setWarehouseArea("06");
            pIn.setWarehousePosition("C07");
            pIn.setUserName(sig4.getUserName());
            pIn.setUserId(sig4.getUserId());
            pIn.setEnterpriseName(sig4.getEnterpriseName());
            pIn.setEnterpriseId(sig4.getEnterpriseId());
            pIn.setWorker(in4worker);
            pIn.setPhone(in4workerPhone);
            pIn.setDatetime("2022-08-07");
        }

        productionSchedulingDto3_1 = productionService.getByIdProductionScheduling(
                Long.valueOf(productionSchedulingDto3_1.getId()));
        prodInboundDto3_1.setBatch(productionSchedulingDto3_1.getBatchNumber());
        productionSchedulingDto3_2 = productionService.getByIdProductionScheduling(
                Long.valueOf(productionSchedulingDto3_2.getId()));
        prodInboundDto3_2.setBatch(productionSchedulingDto3_2.getBatchNumber());
        productionSchedulingDto3_3 = productionService.getByIdProductionScheduling(
                Long.valueOf(productionSchedulingDto3_3.getId()));
        prodInboundDto3_3.setBatch(productionSchedulingDto3_3.getBatchNumber());
        productionSchedulingDto3_4 = productionService.getByIdProductionScheduling(
                Long.valueOf(productionSchedulingDto3_4.getId()));
        prodInboundDto3_4.setBatch(productionSchedulingDto3_4.getBatchNumber());
        productionSchedulingDto3_5 = productionService.getByIdProductionScheduling(
                Long.valueOf(productionSchedulingDto3_5.getId()));
        prodInboundDto3_5.setBatch(productionSchedulingDto3_5.getBatchNumber());

        prodInboundDto3_1 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto3_1));
        prodInboundDto3_2 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto3_2));
        prodInboundDto3_3 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto3_3));
        prodInboundDto3_4 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto3_4));
        prodInboundDto3_5 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto3_5));

        OutboundBillDto saleOutboundDto3_1 = new OutboundBillDto();
        OutboundBillDto saleOutboundDto3_2 = new OutboundBillDto();
        OutboundBillDto saleOutboundDto3_3 = new OutboundBillDto();
        OutboundBillDto saleOutboundDto3_4 = new OutboundBillDto();
        OutboundBillDto saleOutboundDto3_5 = new OutboundBillDto();
        List<OutboundBillDto> batterySaleOutboundList = Arrays.asList(saleOutboundDto3_1, saleOutboundDto3_2,
                saleOutboundDto3_3, saleOutboundDto3_4, saleOutboundDto3_5);

        for (OutboundBillDto pOut:
                batterySaleOutboundList) {
            pOut.setProduct(prodInboundDto3_1.getProduct());
            pOut.setOutboundType(1);
            pOut.setNumber(1200);
//                    .batch(productionSchedulingDto2_1.getBatchNumber())
            pOut.setBomCode(bomE0.getMaterialCode());
            pOut.setDownstream("苏州寰盛");
            pOut.setWarehouse(prodInboundDto3_1.getWarehouse());
            pOut.setWarehouseLocation(prodInboundDto3_1.getWarehouseLocation());
            pOut.setWarehouseArea(prodInboundDto3_1.getWarehouseArea());
            pOut.setWarehousePosition(prodInboundDto3_1.getWarehousePosition());
            pOut.setUserName(sig4.getUserName());
            pOut.setUserId(sig4.getUserId());
            pOut.setEnterpriseName(sig4.getEnterpriseName());
            pOut.setEnterpriseId(sig4.getEnterpriseId());
            pOut.setWorker(in4worker);
            pOut.setPhone(in4workerPhone);
            pOut.setDatetime("2022-08-16");
            pOut.setLogistics("韵达物流");
            pOut.setTrackingNumber("YD107749556083214");
//                    .stockId(saleOutboundDto2.getStockId())
        }
        saleOutboundDto3_1.setBatch(productionSchedulingDto3_1.getBatchNumber());
        saleOutboundDto3_1.setStockId(prodInboundDto3_1.getStockId());
        saleOutboundDto3_2.setBatch(productionSchedulingDto3_2.getBatchNumber());
        saleOutboundDto3_2.setStockId(prodInboundDto3_2.getStockId());
        saleOutboundDto3_3.setBatch(productionSchedulingDto3_3.getBatchNumber());
        saleOutboundDto3_3.setStockId(prodInboundDto3_3.getStockId());
        saleOutboundDto3_4.setBatch(productionSchedulingDto3_4.getBatchNumber());
        saleOutboundDto3_4.setStockId(prodInboundDto3_4.getStockId());
        saleOutboundDto3_5.setBatch(productionSchedulingDto3_5.getBatchNumber());
        saleOutboundDto3_5.setStockId(prodInboundDto3_5.getStockId());

        for (OutboundBillDto pOut:
                batterySaleOutboundList) {
            warehouseService.createOutboundBill(pOut);
        }

        InspectionRequestDto inspectionRequestDto3_2 = InspectionRequestDto.builder()
                .inspectionType(3)
                .referenceDocumentType(4)
                .referenceDocumentNumber(productionSchedulingDto3_2.getBatchNumber())
                .batchNumber(productionSchedulingDto3_2.getBatchNumber())
                .inspectionQuantity(1200)
                .materialNumber(productionSchedulingDto3_2.getMaterialCode())
                .materialName(productionSchedulingDto3_2.getMaterialName())
                .materialDesc(bomE0.getMaterialDesc())
                .manufacturer(sig4.getEnterpriseName())
                .manufacturerMaterialCode(productionSchedulingDto3_2.getMaterialCode())
                .inspectionMethod(2)
                .samplingStandard("随机抽样")
                .inspector(sig4.getUserName())
                .inspectionDepartment("QC001")
                .requestDepartment("QC001")
                .requestor(sig4.getUserName())
                .requestTime("2022-08-08")
                .userName(sig4.getUserName())
                .enterpriseName(sig4.getEnterpriseName()).build();

        InspectionRequestItemDto inspectionRequestItemDto3_2_1 = InspectionRequestItemDto.builder()
                .inspectionItem("循环寿命").inspectionMethod("电气测试")
                .samplingStandard("百抽一").inspectionIndex("循环后剩余容量百分比")
                .qualityStandard("寿命测试标准")
                .testMethod("3000次充放电").isQuantitative("是")
                .standardValue(99.99F).upperLimit(100.0F).lowerLimit(95.0F)
                .sampleQuantity(120)
                .build();

        InspectionRequestItemDto inspectionRequestItemDto3_2_2 = InspectionRequestItemDto.builder()
                .inspectionItem("温度性能").inspectionMethod("温度测试")
                .samplingStandard("五十抽一").inspectionIndex("温度下供电性能")
                .qualityStandard("温度性能标准")
                .testMethod("-15~65摄氏度恒温箱测试").isQuantitative("是")
                .standardValue(95.0F).upperLimit(100.0F).lowerLimit(95.0F)
                .sampleQuantity(24)
                .build();
        inspectionRequestDto3_2.setInspectionItems(
                Arrays.asList(inspectionRequestItemDto3_2_1,inspectionRequestItemDto3_2_2));

        inspectionRequestDto3_2 = qualityService.createInspectionRequest(inspectionRequestDto3_2);

        // pcb
        ContractDto co2 = contractDtoG;
        OrderDetailDto so2 = orderDetailDtoG;
        ProductionDescDto descDto2 = ProductionDescDto.builder().referenceDocType(1)
                .salesOrderNumber(so2.getId())
                .salesOrderName(so2.getSalesOrderName()).customerName(co2.getCustomerName())
                .contractNumber(co2.getContractNumber()).contractName(co2.getContractName())
                .deliveryDate(co2.getRequiredDeliveryDate()).deliveryGroupNumber(co2.getProductGroup())
                .materialCode(co2.getDeliverable().get(0).getMaterialNumber()).build();

        ProductionScheduleDto scheduleDto2 = ProductionScheduleDto.builder().materialCode(descDto2.getMaterialCode())
                .workOrderType(1).area("S").productionLine("B").processRoute("EA")
                .productionQuantity(500)
                .requiredQuantity(500)
                .plannedStartDate("2025-03-23").plannedEndDate("2025-03-23")
                .actualStartDate("2025-03-23").actualEndDate("2025-03-23")
                .storageQuantity(500).storageLocation("MAIN")
                .build();

        List<BOMInfoDto> bomInfoDtos2 = new ArrayList<>();
        List<MaterialInfoDto> materialInfoDtos2 = new ArrayList<>();
        List<BOMDto> bomDtos2 = designService.getBOMsByOrder(inboundBillDto7.getStockId());
        for (BOMDto designBom:
                bomDtos2) {
            BOMInfoDto bomInfo = BOMInfoDto.builder()
                    .materialCode(designBom.getMaterialCode())
                    .materialName(designBom.getMaterialName())
                    .materialDesc(designBom.getMaterialDesc())
                    .quantity(designBom.getQuantity())
                    .manufacturer(designBom.getManufacturer())
                    .substituteType(1).unit(designBom.getUnit())
                    .build();
            bomInfoDtos2.add(bomInfo);
            MaterialInfoDto matInfo = MaterialInfoDto.builder()
                    .kitStatus(0).materialCode(bomInfo.getMaterialCode())
                    .materialName(bomInfo.getMaterialName())
                    .materialDesc(bomInfo.getMaterialDesc())
                    .unit(bomInfo.getUnit())
                    .issueType(1)
                    .receivedQuantity(bomInfo.getQuantity())
                    .consumedQuantity(bomInfo.getQuantity())
                    .unreceivedQuantity(0).availableQuantity(0)
                    .shortageQuantity(0).plannedArrivalDate("2025-04-02")
                    .actualArrivalDate("2025-04-02").build();
            materialInfoDtos2.add(matInfo);
        }
        List<MatchingPlanDto> matchingPlanDtos2 = new ArrayList<>();
        matchingPlanDtos2.add(new MatchingPlanDto("标准装配方案","标准电子产品装配流程", true));
        matchingPlanDtos2.add(new MatchingPlanDto("紧急生产方案", "紧急订单优先生产流程", false));
        matchingPlanDtos2.add(new MatchingPlanDto("小量试产方案", "新产品小批量试产流程", false));
        PreparationDto preparationDto2 = new PreparationDto(bomInfoDtos2,materialInfoDtos2,matchingPlanDtos2);

        List<SettleRuleDto> settleRuleDtos2 = Arrays.asList(
                new SettleRuleDto("1","仓库",90,"1"),
                new SettleRuleDto("1","质检部",10,"1"));

        CostInfoDto costInfoDto2 = new CostInfoDto(new CostCalcDto(), settleRuleDtos2);

        PlanOrderDetailDto detailDto2 = new PlanOrderDetailDto(null, descDto2, scheduleDto2,
                preparationDto2, "未完工", costInfoDto2,
                sig4.getUserName(), sig4.getEnterpriseName(),false,null,null,
                sig4.getUserId(),sig4.getEnterpriseId());

        String mo2 = planService.createPlanOrder(detailDto2);
        PlanOrderDetailDto planOrderDetailDto2 = planService.getPlanOrderDetail(mo2);

        ProductionWorkorderDto productionWorkorderDto2 = ProductionWorkorderDto.builder()
                .planOrderNo(planOrderDetailDto2.getWorkOrderNumber())
                .materialCode(planOrderDetailDto2.getProductionDesc().getMaterialCode()).workOrderQuantity(500)
                .materialName(bom6.getMaterialName())
                .materialDesc(bom6.getMaterialDesc())
                .area("S")
                .productionLine("PL001").processRoute("standardProcess").plannedStartDate("2025-03-23")
                .plannedEndDate("2025-03-23").workOrderType(1).priority(100).reportedQuantity(0)
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        String woNo = productionService.createProductionWorkorder(productionWorkorderDto2);
        productionWorkorderDto2.setWorkOrderNo(woNo);

        BOMDto bom = designService.getBOMByCode(productionWorkorderDto2.getMaterialCode());
        ProductionSchedulingDto productionSchedulingDto2_1  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("K79903/004").equipmentName("铜酸蚀刻机"+ "K79903/004").area(productionWorkorderDto2.getArea())
                .productionLine(productionWorkorderDto2.getProductionLine()).processRoute(productionWorkorderDto2.getProcessRoute())
                .workOrderNo(productionWorkorderDto2.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto2.getWorkOrderLineNo())
                .materialCode(bom.getMaterialCode()).materialName(bom.getMaterialName())
                .materialDesc(bom.getMaterialDesc())
                .scheduledStartDate(productionWorkorderDto2.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto2.getPlannedEndDate()).scheduledQuantity(500).reportedQuantity(0)
                .createTime(productionWorkorderDto2.getPlannedStartDate())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto2_1);
        productionSchedulingDto2_1.setId(String.valueOf(id));

        productionSchedulingDto2_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto2_1.getId()));


        productionSchedulingDto2_1 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto2_1.getId()));
        productionService.finishWorkOrder(productionWorkorderDto2.getWorkOrderNo());

        planService.finishPlanOrder(planOrderDetailDto2.getWorkOrderNumber(), "COMPLETED");

        productionSchedulingDto2_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto2_1.getId()));

        InboundBillDto prodInboundDto2 = InboundBillDto.builder()
                .product(bom6.getMaterialName())
                .inboundType(2)
                .batch(productionSchedulingDto2_1.getBatchNumber())
                .bomCode(bom6.getMaterialCode())
                .upstream(sig4.getEnterpriseName())
                .number(500)
                .warehouse("JX-7").warehouseLocation("A").warehouseArea("B").warehousePosition("X001")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .worker(faker.name().fullName())
                .phone(faker.phoneNumber().phoneNumber())
                .datetime("2025-03-23").build();

        prodInboundDto2 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto2));

        OutboundBillDto saleOutboundDto2 = OutboundBillDto.builder().product(prodInboundDto2.getProduct())
                .outboundType(1).number(500)
                .batch(productionSchedulingDto2_1.getBatchNumber())
                .bomCode(prodInboundDto2.getBomCode())
                .downstream("苏州寰盛")
                .warehouse(prodInboundDto2.getWarehouse()).warehouseLocation(prodInboundDto2.getWarehouseLocation())
                .warehouseArea(prodInboundDto2.getWarehouseArea())
                .warehousePosition(prodInboundDto2.getWarehousePosition())
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId())
                .worker(prodInboundDto2.getWorker())
                .phone(prodInboundDto2.getPhone())
                .logistics("圆通物流").trackingNumber("YT7790445672220007")
                .datetime("2025-03-24").stockId(prodInboundDto2.getStockId()).build();
        warehouseService.createOutboundBill(saleOutboundDto2);

        // 江苏寰盛物料入库
        // 一级物料入库语句
        String prIn1phone1 = faker.phoneNumber().cellPhone();
        InboundBillDto inboundBillDto01 = InboundBillDto.builder()
                .product(purchaseRequireDto01.getMaterialName())
                .inboundType(1)
                .bomCode(bom01.getMaterialCode())
                .batch("BN202201150017")
                .upstream(purchaseRequireDto01.getSupplierName())
                .logistics("顺丰速运").trackingNumber("SF142876543219")
                .number(purchaseRequireDto01.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.2").warehouseArea("A03").warehousePosition("F004")
                .datetime(purchaseRequireDto01.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto01 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto01));

        InboundBillDto inboundBillDto02 = InboundBillDto.builder()
                .product(purchaseRequireDto02.getMaterialName())
                .inboundType(1)
                .bomCode(bom02.getMaterialCode())
                .batch("BN202201280018")
                .upstream(purchaseRequireDto02.getSupplierName())
                .logistics("德邦物流").trackingNumber("DB789012345678")
                .number(purchaseRequireDto02.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.2").warehouseArea("A03").warehousePosition("F005")
                .datetime(purchaseRequireDto02.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto02 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto02));

        InboundBillDto inboundBillDto03 = InboundBillDto.builder()
                .product(purchaseRequireDto03.getMaterialName())
                .inboundType(1)
                .bomCode(bom03.getMaterialCode())
                .batch("BN202202100019")
                .upstream(purchaseRequireDto03.getSupplierName())
                .logistics("京东物流").trackingNumber("JD345678901234")
                .number(purchaseRequireDto03.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.3").warehouseArea("A04").warehousePosition("G001")
                .datetime(purchaseRequireDto03.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto03 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto03));

        InboundBillDto inboundBillDto04 = InboundBillDto.builder()
                .product(purchaseRequireDto04.getMaterialName())
                .inboundType(1)
                .bomCode(bom04.getMaterialCode())
                .batch("BN202202220020")
                .upstream(purchaseRequireDto04.getSupplierName())
                .logistics("中通快递").trackingNumber("ZT567890123456")
                .number(purchaseRequireDto04.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.3").warehouseArea("A04").warehousePosition("G002")
                .datetime(purchaseRequireDto04.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto04 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto04));

        InboundBillDto inboundBillDto05 = InboundBillDto.builder()
                .product(purchaseRequireDto05.getMaterialName())
                .inboundType(1)
                .bomCode(bom05.getMaterialCode())
                .batch(saleOutboundDto3_2.getBatch())
                .upstream(purchaseRequireDto05.getSupplierName())
                .logistics("韵达物流")
                .trackingNumber("YD107749556083214")
                .number(purchaseRequireDto05.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.4").warehouseArea("A05").warehousePosition("H001")
                .datetime(purchaseRequireDto05.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto05 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto05));

        InboundBillDto inboundBillDto06 = InboundBillDto.builder()
                .product(purchaseRequireDto06.getMaterialName())
                .inboundType(1)
                .bomCode(bom06.getMaterialCode())
                .batch("BN202203180022")
                .upstream(purchaseRequireDto06.getSupplierName())
                .logistics("韵达快递").trackingNumber("YD789012345678")
                .number(purchaseRequireDto06.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.4").warehouseArea("A05").warehousePosition("H002")
                .datetime(purchaseRequireDto06.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto06 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto06));

        InboundBillDto inboundBillDto07 = InboundBillDto.builder()
                .product(purchaseRequireDto07.getMaterialName())
                .inboundType(1)
                .bomCode(bom07.getMaterialCode())
                .batch("BN202203290023")
                .upstream(purchaseRequireDto07.getSupplierName())
                .logistics("申通快递").trackingNumber("ST890123456789")
                .number(purchaseRequireDto07.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.5").warehouseArea("A06").warehousePosition("I001")
                .datetime(purchaseRequireDto07.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto07 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto07));

        InboundBillDto inboundBillDto08 = InboundBillDto.builder()
                .product(purchaseRequireDto08.getMaterialName())
                .inboundType(1)
                .bomCode(bom08.getMaterialCode())
                .batch("BN202204080024")
                .upstream(purchaseRequireDto08.getSupplierName())
                .logistics("EMS").trackingNumber("EM901234567890")
                .number(purchaseRequireDto08.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.5").warehouseArea("A06").warehousePosition("I002")
                .datetime(purchaseRequireDto08.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto08 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto08));

        InboundBillDto inboundBillDto09 = InboundBillDto.builder()
                .product(purchaseRequireDto09.getMaterialName())
                .inboundType(1)
                .bomCode(bom09.getMaterialCode())
                .batch("BN202204190025")
                .upstream(purchaseRequireDto09.getSupplierName())
                .logistics("百世快递").trackingNumber("BS012345678901")
                .number(purchaseRequireDto09.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.6").warehouseArea("A07").warehousePosition("J001")
                .datetime(purchaseRequireDto09.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto09 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto09));

        InboundBillDto inboundBillDto010 = InboundBillDto.builder()
                .product(purchaseRequireDto010.getMaterialName())
                .inboundType(1)
                .bomCode(bom010.getMaterialCode())
                .batch("BN202204270026")
                .upstream(purchaseRequireDto010.getSupplierName())
                .logistics("天天快递").trackingNumber("TT123456789012")
                .number(purchaseRequireDto010.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.6").warehouseArea("A07").warehousePosition("J002")
                .datetime(purchaseRequireDto010.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto010 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto010));

        InboundBillDto inboundBillDto011 = InboundBillDto.builder()
                .product(purchaseRequireDto011.getMaterialName())
                .inboundType(1)
                .bomCode(bom011.getMaterialCode())
                .batch("BN202201200027")
                .upstream(purchaseRequireDto011.getSupplierName())
                .logistics("优速快递").trackingNumber("YS234567890123")
                .number(purchaseRequireDto011.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.7").warehouseArea("A08").warehousePosition("K001")
                .datetime(purchaseRequireDto011.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto011 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto011));

        InboundBillDto inboundBillDto012 = InboundBillDto.builder()
                .product(purchaseRequireDto012.getMaterialName())
                .inboundType(1)
                .bomCode(bom012.getMaterialCode())
                .batch("BN202202150028")
                .upstream(purchaseRequireDto012.getSupplierName())
                .logistics("宅急送").trackingNumber("ZJ345678901234")
                .number(purchaseRequireDto012.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.7").warehouseArea("A08").warehousePosition("K002")
                .datetime(purchaseRequireDto012.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto012 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto012));

        InboundBillDto inboundBillDto013 = InboundBillDto.builder()
                .product(purchaseRequireDto013.getMaterialName())
                .inboundType(1)
                .bomCode(bom013.getMaterialCode())
                .batch("BN202203080029")
                .upstream(purchaseRequireDto013.getSupplierName())
                .logistics("速尔快递").trackingNumber("SE456789012345")
                .number(purchaseRequireDto013.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.8").warehouseArea("A09").warehousePosition("L001")
                .datetime(purchaseRequireDto013.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto013 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto013));

        InboundBillDto inboundBillDto014 = InboundBillDto.builder()
                .product(purchaseRequireDto014.getMaterialName())
                .inboundType(1)
                .bomCode(bom014.getMaterialCode())
                .batch("BN202203250030")
                .upstream(purchaseRequireDto014.getSupplierName())
                .logistics("联邦快递").trackingNumber("FD567890123456")
                .number(purchaseRequireDto014.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.8").warehouseArea("A09").warehousePosition("L002")
                .datetime(purchaseRequireDto014.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto014 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto014));

        InboundBillDto inboundBillDto015 = InboundBillDto.builder()
                .product(purchaseRequireDto015.getMaterialName())
                .inboundType(1)
                .bomCode(bom015.getMaterialCode())
                .batch("BN202204120031")
                .upstream(purchaseRequireDto015.getSupplierName())
                .logistics("DHL").trackingNumber("DH678901234567")
                .number(purchaseRequireDto015.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.9").warehouseArea("A10").warehousePosition("M001")
                .datetime(purchaseRequireDto015.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto015 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto015));

        InboundBillDto inboundBillDto016 = InboundBillDto.builder()
                .product(purchaseRequireDto016.getMaterialName())
                .inboundType(1)
                .bomCode(bom016.getMaterialCode())
                .batch("BN202204300032")
                .upstream(purchaseRequireDto016.getSupplierName())
                .logistics("UPS").trackingNumber("UP789012345678")
                .number(purchaseRequireDto016.getRequiredQuantity()).warehouse("W.V").warehouseLocation("W.V.9").warehouseArea("A10").warehousePosition("M002")
                .datetime(purchaseRequireDto016.getRequiredDeliveryDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        inboundBillDto016 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto016));

        // 一级物料领料出库语句
        OutboundBillDto outboundBillDto01 = OutboundBillDto.builder().product(purchaseRequireDto01.getMaterialName())
                .outboundType(2).number(inboundBillDto01.getNumber())
                .batch(inboundBillDto01.getBatch())
                .warehouse(inboundBillDto01.getWarehouse()).warehouseLocation(inboundBillDto01.getWarehouseLocation())
                .warehouseArea(inboundBillDto01.getWarehouseArea())
                .warehousePosition(inboundBillDto01.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto01.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto01);

        OutboundBillDto outboundBillDto02 = OutboundBillDto.builder().product(purchaseRequireDto02.getMaterialName())
                .outboundType(2).number(inboundBillDto02.getNumber())
                .batch(inboundBillDto02.getBatch())
                .warehouse(inboundBillDto02.getWarehouse()).warehouseLocation(inboundBillDto02.getWarehouseLocation())
                .warehouseArea(inboundBillDto02.getWarehouseArea())
                .warehousePosition(inboundBillDto02.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto02.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto02);

        OutboundBillDto outboundBillDto03 = OutboundBillDto.builder().product(purchaseRequireDto03.getMaterialName())
                .outboundType(2).number(inboundBillDto03.getNumber())
                .batch(inboundBillDto03.getBatch())
                .warehouse(inboundBillDto03.getWarehouse()).warehouseLocation(inboundBillDto03.getWarehouseLocation())
                .warehouseArea(inboundBillDto03.getWarehouseArea())
                .warehousePosition(inboundBillDto03.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto03.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto03);

        OutboundBillDto outboundBillDto04 = OutboundBillDto.builder().product(purchaseRequireDto04.getMaterialName())
                .outboundType(2).number(inboundBillDto04.getNumber())
                .batch(inboundBillDto04.getBatch())
                .warehouse(inboundBillDto04.getWarehouse()).warehouseLocation(inboundBillDto04.getWarehouseLocation())
                .warehouseArea(inboundBillDto04.getWarehouseArea())
                .warehousePosition(inboundBillDto04.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto04.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto04);

        OutboundBillDto outboundBillDto05 = OutboundBillDto.builder().product(purchaseRequireDto05.getMaterialName())
                .outboundType(2).number(inboundBillDto05.getNumber())
                .batch(inboundBillDto05.getBatch())
                .warehouse(inboundBillDto05.getWarehouse()).warehouseLocation(inboundBillDto05.getWarehouseLocation())
                .warehouseArea(inboundBillDto05.getWarehouseArea())
                .warehousePosition(inboundBillDto05.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto05.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto05);

        OutboundBillDto outboundBillDto06 = OutboundBillDto.builder().product(purchaseRequireDto06.getMaterialName())
                .outboundType(2).number(inboundBillDto06.getNumber())
                .batch(inboundBillDto06.getBatch())
                .warehouse(inboundBillDto06.getWarehouse()).warehouseLocation(inboundBillDto06.getWarehouseLocation())
                .warehouseArea(inboundBillDto06.getWarehouseArea())
                .warehousePosition(inboundBillDto06.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto06.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto06);

        OutboundBillDto outboundBillDto07 = OutboundBillDto.builder().product(purchaseRequireDto07.getMaterialName())
                .outboundType(2).number(inboundBillDto07.getNumber())
                .batch(inboundBillDto07.getBatch())
                .warehouse(inboundBillDto07.getWarehouse()).warehouseLocation(inboundBillDto07.getWarehouseLocation())
                .warehouseArea(inboundBillDto07.getWarehouseArea())
                .warehousePosition(inboundBillDto07.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto07.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto07);

        OutboundBillDto outboundBillDto08 = OutboundBillDto.builder().product(purchaseRequireDto08.getMaterialName())
                .outboundType(2).number(inboundBillDto08.getNumber())
                .batch(inboundBillDto08.getBatch())
                .warehouse(inboundBillDto08.getWarehouse()).warehouseLocation(inboundBillDto08.getWarehouseLocation())
                .warehouseArea(inboundBillDto08.getWarehouseArea())
                .warehousePosition(inboundBillDto08.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto08.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto08);

        OutboundBillDto outboundBillDto09 = OutboundBillDto.builder().product(purchaseRequireDto09.getMaterialName())
                .outboundType(2).number(inboundBillDto09.getNumber())
                .batch(inboundBillDto09.getBatch())
                .warehouse(inboundBillDto09.getWarehouse()).warehouseLocation(inboundBillDto09.getWarehouseLocation())
                .warehouseArea(inboundBillDto09.getWarehouseArea())
                .warehousePosition(inboundBillDto09.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto09.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto09);

        OutboundBillDto outboundBillDto010 = OutboundBillDto.builder().product(purchaseRequireDto010.getMaterialName())
                .outboundType(2).number(inboundBillDto010.getNumber())
                .batch(inboundBillDto010.getBatch())
                .warehouse(inboundBillDto010.getWarehouse()).warehouseLocation(inboundBillDto010.getWarehouseLocation())
                .warehouseArea(inboundBillDto010.getWarehouseArea())
                .warehousePosition(inboundBillDto010.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto010.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto010);

        OutboundBillDto outboundBillDto011 = OutboundBillDto.builder().product(purchaseRequireDto011.getMaterialName())
                .outboundType(2).number(inboundBillDto011.getNumber())
                .batch(inboundBillDto011.getBatch())
                .warehouse(inboundBillDto011.getWarehouse()).warehouseLocation(inboundBillDto011.getWarehouseLocation())
                .warehouseArea(inboundBillDto011.getWarehouseArea())
                .warehousePosition(inboundBillDto011.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto011.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto011);

        OutboundBillDto outboundBillDto012 = OutboundBillDto.builder().product(purchaseRequireDto012.getMaterialName())
                .outboundType(2).number(inboundBillDto012.getNumber())
                .batch(inboundBillDto012.getBatch())
                .warehouse(inboundBillDto012.getWarehouse()).warehouseLocation(inboundBillDto012.getWarehouseLocation())
                .warehouseArea(inboundBillDto012.getWarehouseArea())
                .warehousePosition(inboundBillDto012.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto012.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto012);

        OutboundBillDto outboundBillDto013 = OutboundBillDto.builder().product(purchaseRequireDto013.getMaterialName())
                .outboundType(2).number(inboundBillDto013.getNumber())
                .batch(inboundBillDto013.getBatch())
                .warehouse(inboundBillDto013.getWarehouse()).warehouseLocation(inboundBillDto013.getWarehouseLocation())
                .warehouseArea(inboundBillDto013.getWarehouseArea())
                .warehousePosition(inboundBillDto013.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto013.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto013);

        OutboundBillDto outboundBillDto014 = OutboundBillDto.builder().product(purchaseRequireDto014.getMaterialName())
                .outboundType(2).number(inboundBillDto014.getNumber())
                .batch(inboundBillDto014.getBatch())
                .warehouse(inboundBillDto014.getWarehouse()).warehouseLocation(inboundBillDto014.getWarehouseLocation())
                .warehouseArea(inboundBillDto014.getWarehouseArea())
                .warehousePosition(inboundBillDto014.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto014.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto014);

        OutboundBillDto outboundBillDto015 = OutboundBillDto.builder().product(purchaseRequireDto015.getMaterialName())
                .outboundType(2).number(inboundBillDto015.getNumber())
                .batch(inboundBillDto015.getBatch())
                .warehouse(inboundBillDto015.getWarehouse()).warehouseLocation(inboundBillDto015.getWarehouseLocation())
                .warehouseArea(inboundBillDto015.getWarehouseArea())
                .warehousePosition(inboundBillDto015.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto015.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto015);

        OutboundBillDto outboundBillDto016 = OutboundBillDto.builder().product(purchaseRequireDto016.getMaterialName())
                .outboundType(2).number(inboundBillDto016.getNumber())
                .batch(inboundBillDto016.getBatch())
                .warehouse(inboundBillDto016.getWarehouse()).warehouseLocation(inboundBillDto016.getWarehouseLocation())
                .warehouseArea(inboundBillDto016.getWarehouseArea())
                .warehousePosition(inboundBillDto016.getWarehousePosition())
                .datetime("2022-08-20").stockId(inboundBillDto016.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        warehouseService.createOutboundBill(outboundBillDto016);


        // 手机生产
        ContractDto co4 = contractDtoI;
        OrderDetailDto so4 = orderDetailDtoI;
        ProductionDescDto descDto4 = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(so4.getId())
                .salesOrderName(so4.getSalesOrderName()).customerName(co4.getCustomerName())
                .contractNumber(co4.getContractNumber()).contractName(co4.getContractName())
                .deliveryDate(co4.getRequiredDeliveryDate()).deliveryGroupNumber(co4.getProductGroup())
                .materialCode(co4.getDeliverable().get(0).getMaterialNumber()).build();

        ProductionScheduleDto scheduleDto4 = ProductionScheduleDto.builder().materialCode(descDto4.getMaterialCode())
                .workOrderType(1).area("E").productionLine("A").processRoute("GA")
                .productionQuantity(6000)
                .requiredQuantity(6000)
                .plannedStartDate("2022-08-20").plannedEndDate("2022-08-20")
                .actualStartDate("2022-08-20").actualEndDate("2022-08-20")
                .storageQuantity(6000).storageLocation("MAIN")
                .build();

        List<BOMInfoDto> bomInfoDtos4 = new ArrayList<>();
        List<MaterialInfoDto> materialInfoDtos4 = new ArrayList<>();
        List<BOMDto> bomDtos4 = designService.getBOMsByOrder(inboundBillDto01.getStockId());
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto02.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto03.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto04.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto05.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto06.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto07.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto08.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto09.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto010.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto011.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto012.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto013.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto014.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto015.getStockId()));
        bomDtos4.addAll(designService.getBOMsByOrder(inboundBillDto016.getStockId()));
        for (BOMDto designBom:
                bomDtos4) {
            BOMInfoDto bomInfo = BOMInfoDto.builder()
                    .materialCode(designBom.getMaterialCode())
                    .materialName(designBom.getMaterialName())
                    .materialDesc(designBom.getMaterialDesc())
                    .quantity(designBom.getQuantity())
                    .manufacturer(designBom.getManufacturer())
                    .substituteType(1).unit(designBom.getUnit())
                    .build();
            bomInfoDtos4.add(bomInfo);
            MaterialInfoDto matInfo = MaterialInfoDto.builder()
                    .kitStatus(0).materialCode(bomInfo.getMaterialCode())
                    .materialName(bomInfo.getMaterialName())
                    .materialDesc(bomInfo.getMaterialDesc())
                    .unit(bomInfo.getUnit())
                    .issueType(1)
                    .receivedQuantity(bomInfo.getQuantity())
                    .consumedQuantity(bomInfo.getQuantity())
                    .unreceivedQuantity(0).availableQuantity(0)
                    .shortageQuantity(0).plannedArrivalDate("2022-08-20")
                    .actualArrivalDate("2022-08-20").build();
            materialInfoDtos4.add(matInfo);
        }
        List<MatchingPlanDto> matchingPlanDtos4 = new ArrayList<>();
        matchingPlanDtos4.add(new MatchingPlanDto("标准装配方案","标准电子产品装配流程", true));
        matchingPlanDtos4.add(new MatchingPlanDto("紧急生产方案", "紧急订单优先生产流程", false));
        matchingPlanDtos4.add(new MatchingPlanDto("小量试产方案", "新产品小批量试产流程", false));
        PreparationDto preparationDto4 = new PreparationDto(bomInfoDtos4,materialInfoDtos4,matchingPlanDtos4);

        List<SettleRuleDto> settleRuleDtos4 = Arrays.asList(
                new SettleRuleDto("1","仓库",90,"1"),
                new SettleRuleDto("1","质检部",10,"1"));

        CostInfoDto costInfoDto4 = new CostInfoDto(new CostCalcDto(), settleRuleDtos4);

        PlanOrderDetailDto detailDto4 = new PlanOrderDetailDto(null, descDto4, scheduleDto4,
                preparationDto4, "未完工", costInfoDto4,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        String mo4 = planService.createPlanOrder(detailDto4);
        PlanOrderDetailDto planOrderDetailDto4 = planService.getPlanOrderDetail(mo4);

        ProductionWorkorderDto productionWorkorderDto4 = ProductionWorkorderDto.builder()
                .planOrderNo(planOrderDetailDto4.getWorkOrderNumber())
                .materialCode(planOrderDetailDto4.getProductionDesc().getMaterialCode())
                .materialName(bom00.getMaterialName())
                .materialDesc(bom00.getMaterialDesc())
                .workOrderQuantity(scheduleDto4.getRequiredQuantity())
                .area("C001")
                .referenceDocType("0")
                .productionLine("PL004").processRoute("precisionProcess")
                .plannedStartDate("2022-08-20")
                .plannedEndDate("2022-08-20")
                .workOrderType(1).priority(1).reportedQuantity(0)
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();
        String woNo4 = productionService.createProductionWorkorder(productionWorkorderDto4);
        productionWorkorderDto4.setWorkOrderNo(woNo4);

        BOMDto poBom4 = designService.getBOMByCode(productionWorkorderDto4.getMaterialCode());
        ProductionSchedulingDto productionSchedulingDto4_1  = ProductionSchedulingDto.builder().workOrderStatus("created")
                .equipmentNo("PL-00142").equipmentName("总装流水线"+ "142").area(productionWorkorderDto4.getArea())
                .productionLine(productionWorkorderDto4.getProductionLine())
                .processRoute(productionWorkorderDto4.getProcessRoute())
                .workOrderNo(productionWorkorderDto4.getWorkOrderNo()).workOrderLineNo(productionWorkorderDto4.getWorkOrderLineNo())
                .materialCode(poBom4.getMaterialCode()).materialName(poBom4.getMaterialName())
                .materialDesc(poBom4.getMaterialDesc()).scheduledStartDate(productionWorkorderDto4.getPlannedStartDate())
                .scheduledEndDate(productionWorkorderDto4.getPlannedEndDate())
                .createTime(productionWorkorderDto4.getPlannedStartDate())
                .scheduledQuantity(6000).reportedQuantity(0)
                .userName(sig2sche.getUserName())
                .userId(sig2sche.getUserId())
                .enterpriseName(sig1.getEnterpriseName())
                .enterpriseId(sig1.getEnterpriseId()).build();
        id = productionService.createProductionScheduling(productionSchedulingDto4_1);
        productionSchedulingDto4_1.setId(String.valueOf(id));
        productionSchedulingDto4_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto4_1.getId()));
        productionSchedulingDto4_1 = productionService.finishScheduling(Long.valueOf(productionSchedulingDto4_1.getId()));

        // 仓库设置,先换别的等批次号更新
        WarehouseLocationDto warehouseLocationDto1 = WarehouseLocationDto.builder().warehouseNumber("A")
                .warehouseName("库存地点A").build();
        WarehouseAreaDto warehouseAreaDto1 = WarehouseAreaDto.builder()
                .areaNumber("B")
                .positionX("1").positionY("1").positionZ("1").build();
        WarehousePositionDto warehousePositionDto1 = WarehousePositionDto.builder().positionNumber("C").build();
        warehouseService.createWarehouseLocation(warehouseLocationDto1);
        warehouseService.createWareHouseArea(warehouseAreaDto1);
        warehouseService.createWarehousePosition(warehousePositionDto1);


        InboundBillDto inboundBillDto1 = InboundBillDto.builder().product(purchaseRequireDto1.getMaterialName())
                .inboundType(1)
                .upstream(purchaseRequireDto1.getSupplierName())
                .bomCode(bomDto1.getMaterialCode())
                .logistics("顺丰").trackingNumber("SF70045686870001")
                .batch("BN202503150017")
                .number(purchaseRequireDto1.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C001")
                .worker(faker.name().fullName())
                .phone(faker.phoneNumber().cellPhone())
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .datetime("2025-07-30").build();
        InboundBillDto inboundBillDto2 = InboundBillDto.builder()
                .product(purchaseRequireDto2.getMaterialName())
                .bomCode(bomDto2.getMaterialCode())
                .inboundType(1)
                .batch("BN202504280018")
                .upstream(purchaseRequireDto2.getSupplierName()).logistics("顺丰").trackingNumber("SF70045687450482")
                .number(purchaseRequireDto2.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C003")
                .worker(faker.name().fullName())
                .phone(faker.phoneNumber().cellPhone())
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .datetime("2025-08-02").build();
        InboundBillDto inboundBillDto3 = InboundBillDto.builder()
                .product(purchaseRequireDto3.getMaterialName())
                .bomCode(bomDto3.getMaterialCode())
                .inboundType(1)
                .batch("BN202506100019")
                .upstream(purchaseRequireDto2.getSupplierName()).logistics("顺丰").trackingNumber("SF70739567450482")
                .number(purchaseRequireDto2.getRequiredQuantity())
                .worker(faker.name().fullName())
                .phone(faker.phoneNumber().cellPhone())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C003")
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .datetime("2025-08-05").build();

        InboundBillDto inboundBillDto4 = InboundBillDto.builder().product(purchaseRequireDto4.getMaterialName())
                .inboundType(1)
                .bomCode("PD-45A")
                .batch("BN2025091605123")
                .upstream(purchaseRequireDto4.getSupplierName()).logistics("顺丰").trackingNumber("SF70042684360458")
                .number(purchaseRequireDto4.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C003")
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .datetime(purchaseRequireDto4.getPlannedArrivalDate()).build();
        InboundBillDto inboundBillDto5 = InboundBillDto.builder().product(purchaseRequireDto5.getMaterialName())
                .inboundType(1)
                .bomCode("PCB-8L")
                .batch(productionSchedulingDto2_1.getBatchNumber())
                .upstream(purchaseRequireDto5.getSupplierName()).logistics("顺丰").trackingNumber("SF24552685360558")
                .number(purchaseRequireDto5.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C003")
                .datetime(purchaseRequireDto5.getPlannedArrivalDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        InboundBillDto inboundBillDto6 = InboundBillDto.builder().product(purchaseRequireDto6.getMaterialName())
                .inboundType(1)
                .bomCode("AL-6061")
                .batch("BN2025092905004")
                .upstream(purchaseRequireDto6.getSupplierName()).logistics("邮政").trackingNumber("EMS4762956360668")
                .number(purchaseRequireDto6.getRequiredQuantity())
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C003")
                .datetime(purchaseRequireDto6.getPlannedArrivalDate())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();


        inboundBillDto1 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto1));
        inboundBillDto2 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto2));
        inboundBillDto3 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto3));

        inboundBillDto4 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto4));
        inboundBillDto5 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto5));
        inboundBillDto6 = warehouseService.getInboundBill(warehouseService.createInboundBill(inboundBillDto6));

        OutboundBillDto outboundBillDto1 = OutboundBillDto.builder().product(purchaseRequireDto1.getMaterialName())
                .outboundType(2).number(2000)
                .warehouse(inboundBillDto1.getWarehouse()).warehouseLocation(inboundBillDto1.getWarehouseLocation())
                .warehouseArea(inboundBillDto1.getWarehouseArea())
                .warehousePosition(inboundBillDto1.getWarehousePosition())
                .datetime("2025-08-07").stockId(inboundBillDto1.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        OutboundBillDto outboundBillDto2 = OutboundBillDto.builder().product(purchaseRequireDto2.getMaterialName())
                .outboundType(2).number(2000)
                .warehouse(inboundBillDto2.getWarehouse()).warehouseLocation(inboundBillDto2.getWarehouseLocation())
                .warehouseArea(inboundBillDto2.getWarehouseArea())
                .warehousePosition(inboundBillDto2.getWarehousePosition())
                .datetime("2025-08-07").stockId(inboundBillDto2.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        OutboundBillDto outboundBillDto3 = OutboundBillDto.builder().product(purchaseRequireDto3.getMaterialName())
                .outboundType(2).number(2000)
                .warehouse(inboundBillDto3.getWarehouse()).warehouseLocation(inboundBillDto3.getWarehouseLocation())
                .warehouseArea(inboundBillDto3.getWarehouseArea())
                .warehousePosition(inboundBillDto3.getWarehousePosition())
                .datetime("2025-08-07").stockId(inboundBillDto3.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        OutboundBillDto outboundBillDto4 = OutboundBillDto.builder().product(purchaseRequireDto4.getMaterialName())
                .outboundType(2).number(2000)
                .warehouse(inboundBillDto4.getWarehouse()).warehouseLocation(inboundBillDto4.getWarehouseLocation())
                .warehouseArea(inboundBillDto4.getWarehouseArea())
                .warehousePosition(inboundBillDto4.getWarehousePosition())
                .datetime("2025-04-02").stockId(inboundBillDto4.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        OutboundBillDto outboundBillDto5 = OutboundBillDto.builder().product(purchaseRequireDto5.getMaterialName())
                .outboundType(2).number(500)
                .warehouse(inboundBillDto5.getWarehouse()).warehouseLocation(inboundBillDto5.getWarehouseLocation())
                .warehouseArea(inboundBillDto5.getWarehouseArea())
                .warehousePosition(inboundBillDto5.getWarehousePosition())
                .datetime("2025-04-02").stockId(inboundBillDto5.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();
        OutboundBillDto outboundBillDto6 = OutboundBillDto.builder().product(purchaseRequireDto6.getMaterialName())
                .outboundType(2).number(500)
                .warehouse(inboundBillDto6.getWarehouse()).warehouseLocation(inboundBillDto6.getWarehouseLocation())
                .warehouseArea(inboundBillDto6.getWarehouseArea())
                .warehousePosition(inboundBillDto6.getWarehousePosition())
                .datetime("2025-04-02").stockId(inboundBillDto6.getStockId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId()).build();

        warehouseService.createOutboundBill(outboundBillDto1);
        warehouseService.createOutboundBill(outboundBillDto2);
        warehouseService.createOutboundBill(outboundBillDto3);
        warehouseService.createOutboundBill(outboundBillDto4);
        warehouseService.createOutboundBill(outboundBillDto5);
        warehouseService.createOutboundBill(outboundBillDto6);

        productionSchedulingDto4_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto4_1.getId()));


        InboundBillDto prodInboundDto4 = InboundBillDto.builder()
                .product(productionSchedulingDto4_1.getMaterialName())
                .inboundType(2)
                .batch(productionSchedulingDto4_1.getBatchNumber())
                .bomCode(productionSchedulingDto4_1.getMaterialCode())
                .upstream(sig1.getEnterpriseName())
                .number(6000)
                .warehouse("W.V").warehouseLocation("W.V.4").warehouseArea("D05").warehousePosition("D009")
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .worker(sig1WH.getUserName())
                .phone(prIn1phone1)
                .datetime("2022-08-20").build();

        prodInboundDto4 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto4));

        InspectionRequestDto inspectionRequestDto4 = InspectionRequestDto.builder()
                .inspectionType(3)
                .referenceDocumentType(4)
                .referenceDocumentNumber(productionSchedulingDto4_1.getBatchNumber())
                .inspectionQuantity(6000)
                .materialNumber(productionSchedulingDto4_1.getMaterialCode())
                .materialName(productionSchedulingDto4_1.getMaterialName())
                .materialDesc(productionSchedulingDto4_1.getMaterialDesc())
                .manufacturer(sig1PL.getEnterpriseName())
                .inspectionMethod(1)
                .samplingStandard("不抽样")
                .inspector(sig1PL.getUserName())
                .inspectionDepartment("QC001")
                .requestDepartment("QC001")
                .requestor(sig1PL.getUserName())
                .requestTime("2022-08-21")
                .userName(sig1PL.getUserName())
                .enterpriseName(sig1PL.getEnterpriseName()).build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone1 = InspectionRequestItemDto.builder()
                .inspectionItem("屏幕显示质量").inspectionMethod("光学测试")
                .samplingStandard("不抽样")
                .inspectionIndex("色彩准确性")
                .qualityStandard("显示质量标准")
                .testMethod("色彩分析仪").isQuantitative("是")
                .standardValue(95.0F).upperLimit(100.0F).lowerLimit(90.0F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone2 = InspectionRequestItemDto.builder()
                .inspectionItem("摄像头对焦").inspectionMethod("光学性能")
                .samplingStandard("不抽样").inspectionIndex("对焦速度")
                .qualityStandard("摄像对焦标准")
                .testMethod("对焦测试仪").isQuantitative("是")
                .standardValue(0.3F).upperLimit(0.5F).lowerLimit(0.2F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone3 = InspectionRequestItemDto.builder()
                .inspectionItem("电池续航").inspectionMethod("性能测试")
                .samplingStandard("不抽样").inspectionIndex("使用时间")
                .qualityStandard("续航能力标准")
                .testMethod("续航测试仪").isQuantitative("是")
                .standardValue(18.0F).upperLimit(20.0F).lowerLimit(16.0F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone4 = InspectionRequestItemDto.builder()
                .inspectionItem("网络连接").inspectionMethod("通信测试")
                .samplingStandard("不抽样").inspectionIndex("信号强度")
                .qualityStandard("网络连接标准")
                .testMethod("信号测试仪").isQuantitative("是")
                .standardValue(-75.0F).upperLimit(-65.0F).lowerLimit(-85.0F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone5 = InspectionRequestItemDto.builder()
                .inspectionItem("外观完整性").inspectionMethod("目视检验")
                .samplingStandard("不抽样").inspectionIndex("无划痕")
                .qualityStandard("外观质量标准")
                .testMethod("目视检查").isQuantitative("否")
                .standardValue(0F).upperLimit(0F).lowerLimit(0F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone6 = InspectionRequestItemDto.builder()
                .inspectionItem("音频输出").inspectionMethod("声学测试")
                .samplingStandard("不抽样").inspectionIndex("音质清晰度")
                .qualityStandard("音频质量标准")
                .testMethod("音频分析仪").isQuantitative("是")
                .standardValue(85.0F).upperLimit(90.0F).lowerLimit(80.0F)
                .sampleQuantity(6000)
                .build();

        InspectionRequestItemDto inspectionRequestItemDtoPhone7 = InspectionRequestItemDto.builder()
                .inspectionItem("充电效率").inspectionMethod("电气测试")
                .samplingStandard("不抽样").inspectionIndex("充电速度")
                .qualityStandard("充电效率标准")
                .testMethod("充电测试仪").isQuantitative("是")
                .standardValue(25.0F).upperLimit(30.0F).lowerLimit(20.0F)
                .sampleQuantity(6000)
                .build();
        inspectionRequestDto4.setInspectionItems(Arrays.asList(inspectionRequestItemDtoPhone1,
                inspectionRequestItemDtoPhone2,inspectionRequestItemDtoPhone3,inspectionRequestItemDtoPhone4,
                inspectionRequestItemDtoPhone5,inspectionRequestItemDtoPhone6,inspectionRequestItemDtoPhone7));

        inspectionRequestDto4 = qualityService.createInspectionRequest(inspectionRequestDto4);
        InspectionOrderDto inspectionOrderDto4 = InspectionOrderDto.builder()
                .inspectionRequestNumber(inspectionRequestDto4.getInspectionRequestNumber())
                .referenceDocumentType(4)
                .inspectionType(3).referenceDocumentNumber(productionSchedulingDto4_1.getBatchNumber())
                .inspectionQuantity(6000)
                .materialNumber(productionSchedulingDto4_1.getMaterialCode())
                .materialName(productionSchedulingDto4_1.getMaterialName())
                .materialDesc(productionSchedulingDto4_1.getMaterialDesc())
                .manufacturer(sig1PL.getEnterpriseName())
                .manufacturerMaterialCode(productionSchedulingDto4_1.getMaterialCode())
                .batchNumber(productionSchedulingDto4_1.getBatchNumber())
                .inspectionMethod(1)
                .samplingStandard("不抽样")
                .requestDepartment("QC003")
                .requestor(sig1PL.getUserName())
                .requestTime("2022-08-21")
                .inspectionPlanName("智能手机普通检验")
                .executionStandard("GB/T 42002-2022")
                .unqualifiedQuantity(0).qualifiedQuantity(6000)
                .inspector(faker.name().fullName())
                .inspectionTime("2022-08-22 14:07:26")
                .userName(sig3QA.getUserName())
                .enterpriseName(sig3QA.getEnterpriseName()).build();
        InspectionOrderItemEntity inspectionOrderItemDtoPhone1 = InspectionOrderItemEntity.builder()
                .inspectionItem("屏幕显示质量").inspectionMethod("光学测试")
                .samplingStandard("不抽样")
                .inspectionIndex("色彩准确性")
                .qualityStandard("显示质量标准")
                .testMethod("色彩分析仪").isQuantitative("是")
                .standardValue(99.9F).upperLimit(100.0F).lowerLimit(99.0F)
                .actualAverage(99.99F).maxValue(99.993F).minValue(99.981F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone2 = InspectionOrderItemEntity.builder()
                .inspectionItem("摄像头对焦").inspectionMethod("光学性能")
                .samplingStandard("不抽样").inspectionIndex("对焦速度")
                .qualityStandard("摄像对焦标准")
                .testMethod("对焦测试仪").isQuantitative("是")
                .standardValue(0.3F).upperLimit(0.5F).lowerLimit(0.0F)
                .actualAverage(0.12F).maxValue(0.13F).minValue(0.09F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone3 = InspectionOrderItemEntity.builder()
                .inspectionItem("电池续航").inspectionMethod("性能测试")
                .samplingStandard("不抽样").inspectionIndex("使用时间")
                .qualityStandard("续航能力标准")
                .testMethod("续航测试仪").isQuantitative("是")
                .standardValue(28.0F).upperLimit(0.0F).lowerLimit(16.0F)
                .actualAverage(31.5F).maxValue(32.3F).minValue(30.9F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone4 = InspectionOrderItemEntity.builder()
                .inspectionItem("网络连接").inspectionMethod("通信测试")
                .samplingStandard("不抽样").inspectionIndex("信号强度")
                .qualityStandard("网络连接标准")
                .testMethod("信号测试仪").isQuantitative("是")
                .standardValue(-75.0F).upperLimit(-65.0F).lowerLimit(-85.0F)
                .actualAverage(-76.1F).maxValue(-74.7F).minValue(-79.1F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone5 = InspectionOrderItemEntity.builder()
                .inspectionItem("外观完整性").inspectionMethod("目视检验")
                .samplingStandard("不抽样").inspectionIndex("无划痕")
                .qualityStandard("外观质量标准")
                .testMethod("目视检查").isQuantitative("否")
                .standardValue(0F).upperLimit(0F).lowerLimit(0F)
                .actualAverage(0F).maxValue(0F).minValue(0F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone6 = InspectionOrderItemEntity.builder()
                .inspectionItem("音频输出").inspectionMethod("声学测试")
                .samplingStandard("不抽样").inspectionIndex("音质清晰度")
                .qualityStandard("音频质量标准")
                .testMethod("音频分析仪").isQuantitative("是")
                .standardValue(85.0F).upperLimit(90.0F).lowerLimit(80.0F)
                .actualAverage(85.2F).maxValue(85.7F).minValue(84.9F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();

        InspectionOrderItemEntity inspectionOrderItemDtoPhone7 = InspectionOrderItemEntity.builder()
                .inspectionItem("充电效率").inspectionMethod("电气测试")
                .samplingStandard("不抽样").inspectionIndex("充电速度")
                .qualityStandard("充电效率标准")
                .testMethod("充电测试仪").isQuantitative("是")
                .standardValue(25.0F).upperLimit(30.0F).lowerLimit(20.0F)
                .actualAverage(23.5F).maxValue(24.7F).minValue(22.5F)
                .qualifiedQuantity(6000).unqualifiedQuantity(0)
                .inspectionConclusion(1).inspector(faker.name().fullName())
                .sampleQuantity(6000)
                .build();
        inspectionOrderDto4.setInspectionItems(Arrays.asList(inspectionOrderItemDtoPhone1,
                inspectionOrderItemDtoPhone2,inspectionOrderItemDtoPhone3,inspectionOrderItemDtoPhone4,
                inspectionOrderItemDtoPhone5,inspectionOrderItemDtoPhone6,inspectionOrderItemDtoPhone7));
        qualityService.createInspectionOrder(inspectionOrderDto4);

        OutboundBillDto saleOutboundDto4 = OutboundBillDto.builder().product(prodInboundDto4.getProduct())
                .outboundType(1).number(6000)
                .batch(prodInboundDto4.getBatch())
                .bomCode(prodInboundDto4.getBomCode())
                .downstream("江苏中亭")
                .warehouse(prodInboundDto4.getWarehouse()).warehouseLocation(prodInboundDto4.getWarehouseLocation())
                .warehouseArea(prodInboundDto4.getWarehouseArea())
                .warehousePosition(prodInboundDto4.getWarehousePosition())
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .worker(prodInboundDto4.getWorker())
                .phone(prodInboundDto4.getPhone())
                .logistics("京东物流").trackingNumber("JD678901234567")
                .datetime("2022-08-25").stockId(prodInboundDto4.getStockId()).build();
        warehouseService.createOutboundBill(saleOutboundDto4);


        // 计划工单
        ContractDto co = contractDtoC;
        OrderDetailDto so = orderDetailDtoC;
        ProductionDescDto descDto = ProductionDescDto.builder().referenceDocType(1).salesOrderNumber(so.getId())
                .salesOrderName(so.getSalesOrderName()).customerName(co.getCustomerName())
                .contractNumber(co.getContractNumber()).contractName(co.getContractName())
                .deliveryDate(co.getRequiredDeliveryDate()).deliveryGroupNumber(co.getProductGroup())
                .materialCode(co.getDeliverable().get(0).getMaterialNumber()).build();

        ProductionScheduleDto scheduleDto = ProductionScheduleDto.builder().materialCode(descDto.getMaterialCode())
                .workOrderType(1).area("E").productionLine("A").processRoute("EA")
                .productionQuantity(500)
                .requiredQuantity(500)
                .plannedStartDate("2025-04-02").plannedEndDate("2025-04-02")
                .actualEndDate("2025-04-02").actualStartDate("2025-04-02")
                .storageQuantity(500).storageLocation("MAIN")
                .build();

        List<BOMInfoDto> bomInfoDtos = new ArrayList<>();
        List<MaterialInfoDto> materialInfoDtos = new ArrayList<>();
        List<BOMDto> bomDtos = designService.getBOMsByOrder(inboundBillDto4.getStockId());
        bomDtos.addAll(designService.getBOMsByOrder(inboundBillDto5.getStockId()));
        bomDtos.addAll(designService.getBOMsByOrder(inboundBillDto6.getStockId()));
        for (BOMDto designBom:
                bomDtos) {

            BOMInfoDto bomInfo = BOMInfoDto.builder()
                    .materialCode(designBom.getMaterialCode())
                    .materialName(designBom.getMaterialName())
                    .materialDesc(designBom.getMaterialDesc())
                    .quantity(designBom.getQuantity())
                    .manufacturer(designBom.getManufacturer())
                    .substituteType(1).unit(designBom.getUnit())
                    .build();
            bomInfoDtos.add(bomInfo);
            MaterialInfoDto matInfo = MaterialInfoDto.builder()
                    .kitStatus(0).materialCode(bomInfo.getMaterialCode())
                    .materialName(bomInfo.getMaterialName())
                    .materialDesc(bomInfo.getMaterialDesc())
                    .unit(bomInfo.getUnit())
                    .issueType(1)
                    .receivedQuantity(bomInfo.getQuantity())
                    .consumedQuantity(bomInfo.getQuantity())
                    .unreceivedQuantity(0).availableQuantity(0)
                    .shortageQuantity(0).plannedArrivalDate("2025-04-02")
                    .actualArrivalDate("2025-04-02").build();
            materialInfoDtos.add(matInfo);
        }
        List<MatchingPlanDto> matchingPlanDtos = new ArrayList<>();
        matchingPlanDtos.add(new MatchingPlanDto("标准装配方案","标准电子产品装配流程", true));
        matchingPlanDtos.add(new MatchingPlanDto("紧急生产方案", "紧急订单优先生产流程", false));
        matchingPlanDtos.add(new MatchingPlanDto("小量试产方案", "新产品小批量试产流程", false));
        PreparationDto preparationDto = new PreparationDto(bomInfoDtos,materialInfoDtos,matchingPlanDtos);

        List<SettleRuleDto> settleRuleDtos = Arrays.asList(
                new SettleRuleDto("1","仓库",90,"1"),
                new SettleRuleDto("1","质检部",10,"1"));

        CostInfoDto costInfoDto = new CostInfoDto(new CostCalcDto(), settleRuleDtos);

        PlanOrderDetailDto detailDto = new PlanOrderDetailDto(null, descDto, scheduleDto,
                preparationDto, "未完工", costInfoDto,
                sig1PL.getUserName(), sig1PL.getEnterpriseName(),false,null,null,
                sig1PL.getUserId(),sig1PL.getEnterpriseId());

        String mo = planService.createPlanOrder(detailDto);
        PlanOrderDetailDto planOrderDetailDto = planService.getPlanOrderDetail(mo);



        // 生产工单
        ProductionWorkorderDto productionWorkorderDto1 = makeSaveProdOrder(planOrderDetailDto, 500, sig1PL);


        // 排程
        ProductionSchedulingDto productionSchedulingDto1_1 = makeSaveProdSchedule(productionWorkorderDto1,"M0-1", 400,sig1PL);
        ProductionSchedulingDto productionSchedulingDto1_2 = makeSaveProdSchedule(productionWorkorderDto1,"M0-2", 100,sig1PL);


        productionService.finishScheduling(Long.valueOf(productionSchedulingDto1_1.getId()));
        productionService.finishScheduling(Long.valueOf(productionSchedulingDto1_2.getId()));


        //更新排程 因为只有finishScheduling之后才会生成排程号
        //productionSchedulingDto1_1 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto1_1.getId()));
        productionSchedulingDto1_2 = productionService.getByIdProductionScheduling(Long.valueOf(productionSchedulingDto1_2.getId()));

//        productionService.finishWorkOrder(productionWorkorderDto2.getWorkOrderNo());
//
//        planService.finishPlanOrder(planOrderDetailDto2.getWorkOrderNumber(), "COMPLETED");

        InspectionRequestDto inspectionRequestDto1 = InspectionRequestDto.builder()
                .inspectionType(3).referenceDocumentNumber(productionSchedulingDto1_2.getBatchNumber())
                .inspectionQuantity(100)
                .materialNumber(productionSchedulingDto1_2.getMaterialCode())
                .materialName(productionSchedulingDto1_2.getMaterialName())
                .materialDesc(productionSchedulingDto1_2.getMaterialDesc())
                .manufacturer(sig1PL.getEnterpriseName())
                .inspectionMethod(1)
                .samplingStandard("不抽样")
                .inspector(sig1PL.getUserName())
                .inspectionDepartment("QC001")
                .requestDepartment("QC001")
                .requestor(sig1PL.getUserName())
                .requestTime("2025-04-02")
                .userName(sig1PL.getUserName())
                .enterpriseName(sig1PL.getEnterpriseName()).build();
        InspectionRequestItemDto inspectionRequestItemDto1 = InspectionRequestItemDto.builder()
                .inspectionItem("长度").inspectionMethod("规格测试").samplingStandard("十抽一").inspectionIndex("范围内")
                .qualityStandard("默认标准")
                .testMethod("游标卡尺测量").isQuantitative("是").standardValue(7.60F).upperLimit(8.15F).lowerLimit(7.55F)
                .sampleQuantity(100)
                .build();
        inspectionRequestDto1.setInspectionItems(Arrays.asList(inspectionRequestItemDto1));

        inspectionRequestDto1 = qualityService.createInspectionRequest(inspectionRequestDto1);

        InboundBillDto prodInboundDto1 = InboundBillDto.builder()
                .product(bom1.getMaterialName())
                .inboundType(2)
                .batch(productionSchedulingDto1_2.getBatchNumber())
                .bomCode("OPX-5000")
                .upstream(sig1.getEnterpriseName())
                .number(100)
                .warehouse("W.V").warehouseLocation("W.V.1").warehouseArea("B03").warehousePosition("C004")
                .userName(sig1WH.getUserName())
                .userId(sig1WH.getUserId())
                .enterpriseName(sig1WH.getEnterpriseName())
                .enterpriseId(sig1WH.getEnterpriseId())
                .worker(sig1WH.getUserName())
                .phone(faker.phoneNumber().phoneNumber())
                .datetime("2025-04-02").build();

        prodInboundDto1 = warehouseService.getInboundBill(warehouseService.createInboundBill(prodInboundDto1));

        DomesticLogisticDto domesticLogisticDto1 = DomesticLogisticDto.builder().worker1(faker.name().fullName())
                .address1(entpAddr).worker2(faker.name().fullName())
                .address2(contractDtoC.getDeliveryAddress()).phone1("0000-0086")
                .phone2(faker.phoneNumber().phoneNumber())
                .status(1).build();
        logisticService.createDomesticLogistic(domesticLogisticDto1);

        ForeignLogisticDto foreignLogisticDto1 = ForeignLogisticDto.builder().no(String.valueOf(orderId1))
                .planShipNum("1").boxNum("1").planShipAmount("750000").unitPrice("750000")
                .shipDate(DateTimeUtils.getCurrentDateForID()).state("Unshipped").build();
        logisticService.createForeignLogistic(foreignLogisticDto1);


        //项目计划
        String projectPlanNo1 = projectService.createProjectPlan(orderDetailDtoA.getId(), sig1PL);
        String projectPlanNo2 =projectService.createProjectPlan(orderDetailDtoC.getId(), sig1PL);

        //项目计划明细
        ProjectPlanDto projectPlanDto1 = projectService.getProjectPlan(projectPlanNo1);
        PlanDetailDto planDetailDto1 = PlanDetailDto.builder().processNode("生产").responsibleDept("生产部").handler("张三").plannedStartDate("2023-05-01").plannedEndDate("2023-05-05").progress("进行中").build();
        PlanDetailDto planDetailDto2 = PlanDetailDto.builder().processNode("质检").responsibleDept("质检部").handler("李四").plannedStartDate("2023-05-06").plannedEndDate("2023-05-10").progress("进行中").build();
        List<PlanDetailDto> planDetailDtoList = new ArrayList<>();
        planDetailDtoList.add(planDetailDto1);
        planDetailDtoList.add(planDetailDto2);
        projectPlanDto1.setPlanDetail(planDetailDtoList);
        projectService.updateProjectPlan(projectPlanNo1,projectPlanDto1);

        //项目文档 项目文档文件夹 项目文档文件夹文件
        ProjectFolderDto projectFolderDto1 = ProjectFolderDto.builder()
                .projectId("1")//项目文档id
                .name("合同文档")
                .description("")
                .build();
        ProjectFolderDto projectFolderDto2 = ProjectFolderDto.builder()
                .projectId("1")//项目文档id
                .name("技术文档")
                .description("")
                .build();
        ProjectFolderDto projectFolderDto3 = ProjectFolderDto.builder()
                .projectId("2")//项目文档id
                .name("交付文档")
                .description("")
                .build();
        ProjectFolderDto projectFolderDto4 = ProjectFolderDto.builder()
                .projectId("2")//项目文档id
                .name("其他文档")
                .description("")
                .build();

        projectService.createProjectDocsFolder(projectFolderDto1);
        projectService.createProjectDocsFolder(projectFolderDto2);
        projectService.createProjectDocsFolder(projectFolderDto3);
        projectService.createProjectDocsFolder(projectFolderDto4);

        //项目任务看板-创建项目节点
        //项目节点
        ProjectNodeDto node1 = ProjectNodeDto.builder()
                .date("2025-08-01")
                .title("项目启动")
                .status("completed")
                .riskLevel("medium")
                .responsiblePerson("张三")
                .responsiblePersonStatus("在职")
                .responsibleDepartment("研发部")
                .handler("李四")
                .handlerDepartment("测试部")
                .plannedStartDate("2025-08-01")
                .plannedEndDate("2025-09-01")
                .contractNo("HT20230101")
                .contractName("软件开发合同")
                .customerName("客户A")
                .requiredDeliveryDate("2023-07-01")
                .salesOrderNo("XS20230101")
                .salesOrderName("销售订单A")
                .deliverables("软件产品")
                .salesperson("王五")
                .projectId("P20230101")
                .color("#67C23A")
                .build();

        ProjectNodeDto node2 = ProjectNodeDto.builder()
                .date("2025-09-01")
                .title("需求分析")
                .status("incompleted")
                .riskLevel("low")
                .responsiblePerson("赵六")
                .responsiblePersonStatus("在职")
                .responsibleDepartment("产品部")
                .handler("孙七")
                .handlerDepartment("设计部")
                .plannedStartDate("2025-09-01")
                .plannedEndDate("2025-11-01")
                .contractNo("HT20230101")
                .contractName("软件开发合同")
                .customerName("客户A")
                .requiredDeliveryDate("2023-07-01")
                .salesOrderNo("XS20230101")
                .salesOrderName("销售订单A")
                .deliverables("需求文档")
                .salesperson("王五")
                .projectId("P20230101")
                .color("#E6A23C")
                .build();
        projectService.createProjectNode(node1);
        projectService.createProjectNode(node2);

        TodoDto todoSO1 = new TodoDto(null,false,"销售订单进行中","销售订单"+orderDetailDtoA.getId(),"info","high",
                orderDetailDtoA.getRequiredDeliveryDate(),
                sig1.getUserName(),sig1.getEnterpriseId());
        TodoDto todoPS1 = new TodoDto(null,false,"生产排程已完成","排程"+productionSchedulingDto1_2.getBatchNumber(),"info","low",
                productionSchedulingDto1_2.getScheduledEndDate(),
                sig1PL.getUserName(),sig1PL.getEnterpriseId());
        TodoDto todoSO2 = new TodoDto(null,false,"销售订单进行中","销售订单"+orderDetailDtoG.getId(),"info","high",
                orderDetailDtoG.getRequiredDeliveryDate(),
                sig4.getUserName(),sig4.getEnterpriseId());

        todoService.createTodo(todoSO1);
        todoService.createTodo(todoSO2);
        todoService.createTodo(todoPS1);

        ProductionProcessDto processDtoPhone = ProductionProcessDto.builder()
                .productName("智能手机")
                .batch(productionSchedulingDto4_1.getBatchNumber())
                .workshop(productionSchedulingDto4_1.getProductionLine())
                .worker(sig2sche.getUserName())
                .phone("17707983779")
                .supplier("众")
                .certificate("http://localhost:8080/api/files/c7272c15-01ec-4fe2-b091-bb29f3bc23b5.jpg")
                .time("2022-08-20")
                .userName(sig1PL.getUserName())
                .userId(sig1PL.getUserId())
                .enterpriseName(sig1PL.getEnterpriseName())
                .enterpriseId(sig1PL.getEnterpriseId()).build();
        ProductionProcessDto processDtoBattery = ProductionProcessDto.builder()
                .productName("石墨烯负极锂离子电池")
                .batch(productionSchedulingDto3_2.getBatchNumber())
                .workshop(productionSchedulingDto3_2.getProductionLine())
                .worker(sig4.getUserName())
                .phone("15377965331")
                .supplier("众")
                .certificate("http://localhost:8080/api/files/98275176-afed-4a08-9df1-808b278f9de6.gif")
                .time("2022-08-07")
                .userName(sig4.getUserName())
                .userId(sig4.getUserId())
                .enterpriseName(sig4.getEnterpriseName())
                .enterpriseId(sig4.getEnterpriseId()).build();

        productionService.createProductionProcess(processDtoPhone);
        productionService.createProductionProcess(processDtoBattery);

        superviseService.reviewTraceApply(processDtoPhone.getBatch(),1);
        superviseService.reviewTraceApply(processDtoBattery.getBatch(),1);



    }
}